Append input path name to UnknownNode errors #185

Merged
5outh merged 2 commits from benjamin/file-name-errors into master 2018-09-23 22:29:43 +02:00
5outh commented 2018-09-17 20:40:09 +02:00 (Migrated from github.com)

Appends the name of the input file to any UnknownNode errors. This is useful when running brittany over a set of source files.

Example output:

ERROR: encountered unknown syntactical constructs when parsing file "library/Application.hs":
HsSpliceE{}
ERROR: encountered unknown syntactical constructs when parsing file "library/Foundation.hs":
HsSpliceE{}
ERROR: encountered unknown syntactical constructs when parsing file "library/FrontRow/Api/ActivityFeed/Handler.hs":
HsBracket{}
HsBracket{}
HsBracket{}
ERROR: encountered unknown syntactical constructs when parsing file "library/FrontRow/Api/DistrictAssessment/Handler/Answers.hs":
HsBracket{}
ERROR: encountered unknown syntactical constructs when parsing stdin:
HsSpliceE{}

Closes #175.

Appends the name of the input file to any `UnknownNode` errors. This is useful when running `brittany` over a set of source files. Example output: ```shell ERROR: encountered unknown syntactical constructs when parsing file "library/Application.hs": HsSpliceE{} ERROR: encountered unknown syntactical constructs when parsing file "library/Foundation.hs": HsSpliceE{} ERROR: encountered unknown syntactical constructs when parsing file "library/FrontRow/Api/ActivityFeed/Handler.hs": HsBracket{} HsBracket{} HsBracket{} ERROR: encountered unknown syntactical constructs when parsing file "library/FrontRow/Api/DistrictAssessment/Handler/Answers.hs": HsBracket{} ``` ```shell ERROR: encountered unknown syntactical constructs when parsing stdin: HsSpliceE{} ``` Closes #175.
lspitzner commented 2018-09-18 00:31:44 +02:00 (Migrated from github.com)

I was so free to push another commit. Would you mind confirming if this still works as desired for some multiple-file testcase?

(and tell if you prefer the previous behaviour - i just thought "wait, we really should have the full srcspan info available in ErrorUnknownNode" and used that.)

I was so free to push another commit. Would you mind confirming if this still works as desired for some multiple-file testcase? (and tell if you prefer the previous behaviour - i just thought "wait, we really should have the full srcspan info available in `ErrorUnknownNode`" and used that.)
5outh commented 2018-09-18 17:45:59 +02:00 (Migrated from github.com)

@lspitzner All works on my end. In fact, that's even better. Thanks!

@lspitzner All works on my end. In fact, that's even better. Thanks!
lspitzner commented 2018-09-23 22:29:48 +02:00 (Migrated from github.com)

thanks!

thanks!
Sign in to join this conversation.
There is no content yet.