on master help sign in
Improve the error message in case of a parse error

Parse errors are typically not Ormolu errors.

commitab179d5a17445864e0f5bd8320d942c9370cf9aa authorMark Karpov <markkarpov92@gmail.com> dateWed 15 Apr 2020, 17:59 (7 years ago) parent0e40431
9 files changed+19
expected-failures/aws.txt+2 expected-failures/distributed-process.txt+2 expected-failures/esqueleto.txt+2 expected-failures/fay.txt+4 expected-failures/idris.txt+2 expected-failures/lens.txt+1 expected-failures/pandoc.txt+1 expected-failures/purescript.txt+4 src/Ormolu/Exception.hs+1
expected-failures/aws.txt+2
@@ -1,9 +1,11 @@
11Parsing of source code failed:
22 Examples/PutBucketNearLine.hs:5:1-6
33 parse error on input `import'
4+GHC parser failed on this input, it is not an Ormolu bug.
45
56Parsing of source code failed:
67 Examples/Sqs.hs:(88,3)-(90,4)
78 parse error on input `{- | Let's make sure the queue was actually deleted and that the same number of queues exist at when
89 | the program ends as when it started.
910 -}'
11+GHC parser failed on this input, it is not an Ormolu bug.
expected-failures/distributed-process.txt+2
@@ -1,7 +1,9 @@
11Parsing of source code failed:
22 benchmarks/Channels.hs:2:1-6
33 parse error on input `import'
4+GHC parser failed on this input, it is not an Ormolu bug.
45
56Parsing of source code failed:
67 benchmarks/Spawns.hs:5:1-6
78 parse error on input `import'
9+GHC parser failed on this input, it is not an Ormolu bug.
expected-failures/esqueleto.txt+2
@@ -1,7 +1,9 @@
11Parsing of source code failed:
22 src/Database/Esqueleto/Internal/Internal.hs:379:1
33 lexical error in string/character literal at character 's'
4+GHC parser failed on this input, it is not an Ormolu bug.
45
56Parsing of source code failed:
67 test/PostgreSQL/Test.hs:510:9-41
78 parse error on input `-- | Check the result is not null'
9+GHC parser failed on this input, it is not an Ormolu bug.
expected-failures/fay.txt+4
@@ -1,18 +1,22 @@
11Parsing of source code failed:
22 examples/Separated.hs:12:1-6
33 parse error on input `module'
4+GHC parser failed on this input, it is not an Ormolu bug.
45
56Parsing of source code failed:
67 examples/calc.hs:(4,1)-(6,2)
78 parse error on input `-- $ fay -p --html-wrapper --html-js-lib jquery.min.js examples/calc.hs
89-- You also need to download jquery.min.js.
910--'
11+GHC parser failed on this input, it is not an Ormolu bug.
1012
1113Parsing of source code failed:
1214 examples/canvaswater.hs:(6,1)-(7,17)
1315 parse error on input `-- | A demonstration of Fay using the canvas element to display a
1416-- simple effect.'
17+GHC parser failed on this input, it is not an Ormolu bug.
1518
1619Parsing of source code failed:
1720 examples/data.hs:9:1-6
1821 parse error on input `module'
22+GHC parser failed on this input, it is not an Ormolu bug.
expected-failures/idris.txt+2
@@ -55,6 +55,7 @@ Please, consider reporting the bug.
5555Parsing of source code failed:
5656 src/Idris/Parser.hs:1052:1
5757 parse error on input `@'
58+GHC parser failed on this input, it is not an Ormolu bug.
5859
5960AST of input and AST of formatted code differ.
6061 at src/Idris/Parser/Data.hs:281:1-29
@@ -63,6 +64,7 @@ Please, consider reporting the bug.
6364Parsing of source code failed:
6465 src/Idris/Parser/Expr.hs:75:1
6566 parse error on input `@'
67+GHC parser failed on this input, it is not an Ormolu bug.
6668
6769Formatting is not idempotent:
6870 src/Idris/PartialEval.hs<rendered>:280:42
expected-failures/lens.txt+1
@@ -1,3 +1,4 @@
11Parsing of source code failed:
22 src/Control/Exception/Lens.hs:180:13-37
33 parse error on input `AllocationLimitExceeded__'
4+GHC parser failed on this input, it is not an Ormolu bug.
expected-failures/pandoc.txt+1
@@ -1,6 +1,7 @@
11Parsing of source code failed:
22 benchmark/weigh-pandoc.hs:14:1-6
33 parse error on input `import'
4+GHC parser failed on this input, it is not an Ormolu bug.
45
56Formatting is not idempotent:
67 src/Text/Pandoc/Readers/Vimwiki.hs<rendered>:615:19
expected-failures/purescript.txt+4
@@ -2,17 +2,21 @@ Parsing of source code failed:
22 src/Language/PureScript/AST/Declarations.hs:478:1-17
33 Invalid type signature: pattern ValueDecl :: ...
44Perhaps you meant to use PatternSynonyms?
5+GHC parser failed on this input, it is not an Ormolu bug.
56
67Parsing of source code failed:
78 src/Language/PureScript/AST/SourcePos.hs:101:1-22
89 Invalid type signature: pattern NullSourceSpan :: ...
910Perhaps you meant to use PatternSynonyms?
11+GHC parser failed on this input, it is not an Ormolu bug.
1012
1113Parsing of source code failed:
1214 src/Language/PureScript/Constants.hs:42:1-15
1315 Invalid type signature: pattern Discard :: ...
1416Perhaps you meant to use PatternSynonyms?
17+GHC parser failed on this input, it is not an Ormolu bug.
1518
1619Parsing of source code failed:
1720 src/Language/PureScript/Crash.hs:16:1-6
1821 parse error on input `import'
22+GHC parser failed on this input, it is not an Ormolu bug.
src/Ormolu/Exception.hs+1
@@ -42,6 +42,7 @@ instance Exception OrmoluException where
4242 ]
4343 OrmoluParsingFailed s e ->
4444 showParsingErr "Parsing of source code failed:" s [e]
45+ ++ "GHC parser failed on this input, it is not an Ormolu bug.\n"
4546 OrmoluOutputParsingFailed s e ->
4647 showParsingErr "Parsing of formatted code failed:" s [e]
4748 ++ "Please, consider reporting the bug.\n"