Improve the error message in case of a parse error (take 2)

This commit is contained in:
Mark Karpov 2020-04-16 12:08:05 +02:00
parent ab179d5a17
commit 44cef926de
9 changed files with 19 additions and 38 deletions

View File

@ -1,11 +1,9 @@
Parsing of source code failed:
The GHC parser (in Haddock mode) failed:
Examples/PutBucketNearLine.hs:5:1-6
parse error on input `import'
GHC parser failed on this input, it is not an Ormolu bug.
Parsing of source code failed:
The GHC parser (in Haddock mode) failed:
Examples/Sqs.hs:(88,3)-(90,4)
parse error on input `{- | Let's make sure the queue was actually deleted and that the same number of queues exist at when
| the program ends as when it started.
-}'
GHC parser failed on this input, it is not an Ormolu bug.

View File

@ -1,9 +1,7 @@
Parsing of source code failed:
The GHC parser (in Haddock mode) failed:
benchmarks/Channels.hs:2:1-6
parse error on input `import'
GHC parser failed on this input, it is not an Ormolu bug.
Parsing of source code failed:
The GHC parser (in Haddock mode) failed:
benchmarks/Spawns.hs:5:1-6
parse error on input `import'
GHC parser failed on this input, it is not an Ormolu bug.

View File

@ -1,9 +1,7 @@
Parsing of source code failed:
The GHC parser (in Haddock mode) failed:
src/Database/Esqueleto/Internal/Internal.hs:379:1
lexical error in string/character literal at character 's'
GHC parser failed on this input, it is not an Ormolu bug.
Parsing of source code failed:
The GHC parser (in Haddock mode) failed:
test/PostgreSQL/Test.hs:510:9-41
parse error on input `-- | Check the result is not null'
GHC parser failed on this input, it is not an Ormolu bug.

View File

@ -1,22 +1,18 @@
Parsing of source code failed:
The GHC parser (in Haddock mode) failed:
examples/Separated.hs:12:1-6
parse error on input `module'
GHC parser failed on this input, it is not an Ormolu bug.
Parsing of source code failed:
The GHC parser (in Haddock mode) failed:
examples/calc.hs:(4,1)-(6,2)
parse error on input `-- $ fay -p --html-wrapper --html-js-lib jquery.min.js examples/calc.hs
-- You also need to download jquery.min.js.
--'
GHC parser failed on this input, it is not an Ormolu bug.
Parsing of source code failed:
The GHC parser (in Haddock mode) failed:
examples/canvaswater.hs:(6,1)-(7,17)
parse error on input `-- | A demonstration of Fay using the canvas element to display a
-- simple effect.'
GHC parser failed on this input, it is not an Ormolu bug.
Parsing of source code failed:
The GHC parser (in Haddock mode) failed:
examples/data.hs:9:1-6
parse error on input `module'
GHC parser failed on this input, it is not an Ormolu bug.

View File

@ -52,19 +52,17 @@ Formatting is not idempotent:
after: "timisation\n = PETra"
Please, consider reporting the bug.
Parsing of source code failed:
The GHC parser (in Haddock mode) failed:
src/Idris/Parser.hs:1052:1
parse error on input `@'
GHC parser failed on this input, it is not an Ormolu bug.
AST of input and AST of formatted code differ.
at src/Idris/Parser/Data.hs:281:1-29
Please, consider reporting the bug.
Parsing of source code failed:
The GHC parser (in Haddock mode) failed:
src/Idris/Parser/Expr.hs:75:1
parse error on input `@'
GHC parser failed on this input, it is not an Ormolu bug.
Formatting is not idempotent:
src/Idris/PartialEval.hs<rendered>:280:42

View File

@ -1,4 +1,3 @@
Parsing of source code failed:
The GHC parser (in Haddock mode) failed:
src/Control/Exception/Lens.hs:180:13-37
parse error on input `AllocationLimitExceeded__'
GHC parser failed on this input, it is not an Ormolu bug.

View File

@ -1,7 +1,6 @@
Parsing of source code failed:
The GHC parser (in Haddock mode) failed:
benchmark/weigh-pandoc.hs:14:1-6
parse error on input `import'
GHC parser failed on this input, it is not an Ormolu bug.
Formatting is not idempotent:
src/Text/Pandoc/Readers/Vimwiki.hs<rendered>:615:19

View File

@ -1,22 +1,18 @@
Parsing of source code failed:
The GHC parser (in Haddock mode) failed:
src/Language/PureScript/AST/Declarations.hs:478:1-17
Invalid type signature: pattern ValueDecl :: ...
Perhaps you meant to use PatternSynonyms?
GHC parser failed on this input, it is not an Ormolu bug.
Parsing of source code failed:
The GHC parser (in Haddock mode) failed:
src/Language/PureScript/AST/SourcePos.hs:101:1-22
Invalid type signature: pattern NullSourceSpan :: ...
Perhaps you meant to use PatternSynonyms?
GHC parser failed on this input, it is not an Ormolu bug.
Parsing of source code failed:
The GHC parser (in Haddock mode) failed:
src/Language/PureScript/Constants.hs:42:1-15
Invalid type signature: pattern Discard :: ...
Perhaps you meant to use PatternSynonyms?
GHC parser failed on this input, it is not an Ormolu bug.
Parsing of source code failed:
The GHC parser (in Haddock mode) failed:
src/Language/PureScript/Crash.hs:16:1-6
parse error on input `import'
GHC parser failed on this input, it is not an Ormolu bug.

View File

@ -41,8 +41,7 @@ instance Exception OrmoluException where
withIndent path
]
OrmoluParsingFailed s e ->
showParsingErr "Parsing of source code failed:" s [e]
++ "GHC parser failed on this input, it is not an Ormolu bug.\n"
showParsingErr "The GHC parser (in Haddock mode) failed:" s [e]
OrmoluOutputParsingFailed s e ->
showParsingErr "Parsing of formatted code failed:" s [e]
++ "Please, consider reporting the bug.\n"