on master help sign in
Improve the error message in case of a parse error (take 2)
commit44cef926de8fcd70a0e35c071f6513636e9b01b7 authorMark Karpov <markkarpov92@gmail.com> dateThu 16 Apr 2020, 12:08 (7 years ago) parentab179d5
9 files changed+19−38
expected-failures/aws.txt+2−4 expected-failures/distributed-process.txt+2−4 expected-failures/esqueleto.txt+2−4 expected-failures/fay.txt+4−8 expected-failures/idris.txt+2−4 expected-failures/lens.txt+1−2 expected-failures/pandoc.txt+1−2 expected-failures/purescript.txt+4−8 src/Ormolu/Exception.hs+1−2
expected-failures/aws.txt+2−4
@@ -1,11 +1,9 @@
1−Parsing of source code failed:
1+The GHC parser (in Haddock mode) 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.
54
6−Parsing of source code failed:
5+The GHC parser (in Haddock mode) failed:
76 Examples/Sqs.hs:(88,3)-(90,4)
87 parse error on input `{- | Let's make sure the queue was actually deleted and that the same number of queues exist at when
98 | the program ends as when it started.
109 -}'
11−GHC parser failed on this input, it is not an Ormolu bug.
expected-failures/distributed-process.txt+2−4
@@ -1,9 +1,7 @@
1−Parsing of source code failed:
1+The GHC parser (in Haddock mode) 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.
54
6−Parsing of source code failed:
5+The GHC parser (in Haddock mode) failed:
76 benchmarks/Spawns.hs:5:1-6
87 parse error on input `import'
9−GHC parser failed on this input, it is not an Ormolu bug.
expected-failures/esqueleto.txt+2−4
@@ -1,9 +1,7 @@
1−Parsing of source code failed:
1+The GHC parser (in Haddock mode) 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.
54
6−Parsing of source code failed:
5+The GHC parser (in Haddock mode) failed:
76 test/PostgreSQL/Test.hs:510:9-41
87 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−8
@@ -1,22 +1,18 @@
1−Parsing of source code failed:
1+The GHC parser (in Haddock mode) 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.
54
6−Parsing of source code failed:
5+The GHC parser (in Haddock mode) failed:
76 examples/calc.hs:(4,1)-(6,2)
87 parse error on input `-- $ fay -p --html-wrapper --html-js-lib jquery.min.js examples/calc.hs
98-- You also need to download jquery.min.js.
109--'
11−GHC parser failed on this input, it is not an Ormolu bug.
1210
13−Parsing of source code failed:
11+The GHC parser (in Haddock mode) failed:
1412 examples/canvaswater.hs:(6,1)-(7,17)
1513 parse error on input `-- | A demonstration of Fay using the canvas element to display a
1614-- simple effect.'
17−GHC parser failed on this input, it is not an Ormolu bug.
1815
19−Parsing of source code failed:
16+The GHC parser (in Haddock mode) failed:
2017 examples/data.hs:9:1-6
2118 parse error on input `module'
22−GHC parser failed on this input, it is not an Ormolu bug.
expected-failures/idris.txt+2−4
@@ -52,19 +52,17 @@ Formatting is not idempotent:
5252 after: "timisation\n = PETra"
5353Please, consider reporting the bug.
5454
55−Parsing of source code failed:
55+The GHC parser (in Haddock mode) 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.
5958
6059AST of input and AST of formatted code differ.
6160 at src/Idris/Parser/Data.hs:281:1-29
6261Please, consider reporting the bug.
6362
64−Parsing of source code failed:
63+The GHC parser (in Haddock mode) failed:
6564 src/Idris/Parser/Expr.hs:75:1
6665 parse error on input `@'
67−GHC parser failed on this input, it is not an Ormolu bug.
6866
6967Formatting is not idempotent:
7068 src/Idris/PartialEval.hs<rendered>:280:42
expected-failures/lens.txt+1−2
@@ -1,4 +1,3 @@
1−Parsing of source code failed:
1+The GHC parser (in Haddock mode) 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−2
@@ -1,7 +1,6 @@
1−Parsing of source code failed:
1+The GHC parser (in Haddock mode) 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.
54
65Formatting is not idempotent:
76 src/Text/Pandoc/Readers/Vimwiki.hs<rendered>:615:19
expected-failures/purescript.txt+4−8
@@ -1,22 +1,18 @@
1−Parsing of source code failed:
1+The GHC parser (in Haddock mode) 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.
65
7−Parsing of source code failed:
6+The GHC parser (in Haddock mode) failed:
87 src/Language/PureScript/AST/SourcePos.hs:101:1-22
98 Invalid type signature: pattern NullSourceSpan :: ...
109Perhaps you meant to use PatternSynonyms?
11−GHC parser failed on this input, it is not an Ormolu bug.
1210
13−Parsing of source code failed:
11+The GHC parser (in Haddock mode) failed:
1412 src/Language/PureScript/Constants.hs:42:1-15
1513 Invalid type signature: pattern Discard :: ...
1614Perhaps you meant to use PatternSynonyms?
17−GHC parser failed on this input, it is not an Ormolu bug.
1815
19−Parsing of source code failed:
16+The GHC parser (in Haddock mode) failed:
2017 src/Language/PureScript/Crash.hs:16:1-6
2118 parse error on input `import'
22−GHC parser failed on this input, it is not an Ormolu bug.
src/Ormolu/Exception.hs+1−2
@@ -41,8 +41,7 @@ instance Exception OrmoluException where
4141 withIndent path
4242 ]
4343 OrmoluParsingFailed s e ->
44− showParsingErr "Parsing of source code failed:" s [e]
45− ++ "GHC parser failed on this input, it is not an Ormolu bug.\n"
44+ showParsingErr "The GHC parser (in Haddock mode) failed:" s [e]
4645 OrmoluOutputParsingFailed s e ->
4746 showParsingErr "Parsing of formatted code failed:" s [e]
4847 ++ "Please, consider reporting the bug.\n"