on master help sign in
Improve the error message in case of a parse error
ab179d5Mark Karpov
expected-failures/aws.txt+2
@@ -1,9 +1,11 @@
1Parsing of source code failed:
1Parsing of source code failed:
2 Examples/PutBucketNearLine.hs:5:1-6
2 Examples/PutBucketNearLine.hs:5:1-6
3 parse error on input `import'
3 parse error on input `import'
4+GHC parser failed on this input, it is not an Ormolu bug.
4
5
5Parsing of source code failed:
6Parsing of source code failed:
6 Examples/Sqs.hs:(88,3)-(90,4)
7 Examples/Sqs.hs:(88,3)-(90,4)
7 parse error on input `{- | Let's make sure the queue was actually deleted and that the same number of queues exist at when
8 parse error on input `{- | Let's make sure the queue was actually deleted and that the same number of queues exist at when
8 | the program ends as when it started.
9 | the program ends as when it started.
9 -}'
10 -}'
11+GHC parser failed on this input, it is not an Ormolu bug.
expected-failures/distributed-process.txt+2
@@ -1,7 +1,9 @@
1Parsing of source code failed:
1Parsing of source code failed:
2 benchmarks/Channels.hs:2:1-6
2 benchmarks/Channels.hs:2:1-6
3 parse error on input `import'
3 parse error on input `import'
4+GHC parser failed on this input, it is not an Ormolu bug.
4
5
5Parsing of source code failed:
6Parsing of source code failed:
6 benchmarks/Spawns.hs:5:1-6
7 benchmarks/Spawns.hs:5:1-6
7 parse error on input `import'
8 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 @@
1Parsing of source code failed:
1Parsing of source code failed:
2 src/Database/Esqueleto/Internal/Internal.hs:379:1
2 src/Database/Esqueleto/Internal/Internal.hs:379:1
3 lexical error in string/character literal at character 's'
3 lexical error in string/character literal at character 's'
4+GHC parser failed on this input, it is not an Ormolu bug.
4
5
5Parsing of source code failed:
6Parsing of source code failed:
6 test/PostgreSQL/Test.hs:510:9-41
7 test/PostgreSQL/Test.hs:510:9-41
7 parse error on input `-- | Check the result is not null'
8 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 @@
1Parsing of source code failed:
1Parsing of source code failed:
2 examples/Separated.hs:12:1-6
2 examples/Separated.hs:12:1-6
3 parse error on input `module'
3 parse error on input `module'
4+GHC parser failed on this input, it is not an Ormolu bug.
4
5
5Parsing of source code failed:
6Parsing of source code failed:
6 examples/calc.hs:(4,1)-(6,2)
7 examples/calc.hs:(4,1)-(6,2)
7 parse error on input `-- $ fay -p --html-wrapper --html-js-lib jquery.min.js examples/calc.hs
8 parse error on input `-- $ fay -p --html-wrapper --html-js-lib jquery.min.js examples/calc.hs
8-- You also need to download jquery.min.js.
9-- You also need to download jquery.min.js.
9--'
10--'
11+GHC parser failed on this input, it is not an Ormolu bug.
10
12
11Parsing of source code failed:
13Parsing of source code failed:
12 examples/canvaswater.hs:(6,1)-(7,17)
14 examples/canvaswater.hs:(6,1)-(7,17)
13 parse error on input `-- | A demonstration of Fay using the canvas element to display a
15 parse error on input `-- | A demonstration of Fay using the canvas element to display a
14-- simple effect.'
16-- simple effect.'
17+GHC parser failed on this input, it is not an Ormolu bug.
15
18
16Parsing of source code failed:
19Parsing of source code failed:
17 examples/data.hs:9:1-6
20 examples/data.hs:9:1-6
18 parse error on input `module'
21 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.
55Parsing of source code failed:
55Parsing of source code failed:
56 src/Idris/Parser.hs:1052:1
56 src/Idris/Parser.hs:1052:1
57 parse error on input `@'
57 parse error on input `@'
58+GHC parser failed on this input, it is not an Ormolu bug.
58
59
59AST of input and AST of formatted code differ.
60AST of input and AST of formatted code differ.
60 at src/Idris/Parser/Data.hs:281:1-29
61 at src/Idris/Parser/Data.hs:281:1-29
@@ -63,6 +64,7 @@ Please, consider reporting the bug.
63Parsing of source code failed:
64Parsing of source code failed:
64 src/Idris/Parser/Expr.hs:75:1
65 src/Idris/Parser/Expr.hs:75:1
65 parse error on input `@'
66 parse error on input `@'
67+GHC parser failed on this input, it is not an Ormolu bug.
66
68
67Formatting is not idempotent:
69Formatting is not idempotent:
68 src/Idris/PartialEval.hs<rendered>:280:42
70 src/Idris/PartialEval.hs<rendered>:280:42
expected-failures/lens.txt+1
@@ -1,3 +1,4 @@
1Parsing of source code failed:
1Parsing of source code failed:
2 src/Control/Exception/Lens.hs:180:13-37
2 src/Control/Exception/Lens.hs:180:13-37
3 parse error on input `AllocationLimitExceeded__'
3 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 @@
1Parsing of source code failed:
1Parsing of source code failed:
2 benchmark/weigh-pandoc.hs:14:1-6
2 benchmark/weigh-pandoc.hs:14:1-6
3 parse error on input `import'
3 parse error on input `import'
4+GHC parser failed on this input, it is not an Ormolu bug.
4
5
5Formatting is not idempotent:
6Formatting is not idempotent:
6 src/Text/Pandoc/Readers/Vimwiki.hs<rendered>:615:19
7 src/Text/Pandoc/Readers/Vimwiki.hs<rendered>:615:19
expected-failures/purescript.txt+4
@@ -2,17 +2,21 @@ Parsing of source code failed:
2 src/Language/PureScript/AST/Declarations.hs:478:1-17
2 src/Language/PureScript/AST/Declarations.hs:478:1-17
3 Invalid type signature: pattern ValueDecl :: ...
3 Invalid type signature: pattern ValueDecl :: ...
4Perhaps you meant to use PatternSynonyms?
4Perhaps you meant to use PatternSynonyms?
5+GHC parser failed on this input, it is not an Ormolu bug.
5
6
6Parsing of source code failed:
7Parsing of source code failed:
7 src/Language/PureScript/AST/SourcePos.hs:101:1-22
8 src/Language/PureScript/AST/SourcePos.hs:101:1-22
8 Invalid type signature: pattern NullSourceSpan :: ...
9 Invalid type signature: pattern NullSourceSpan :: ...
9Perhaps you meant to use PatternSynonyms?
10Perhaps you meant to use PatternSynonyms?
11+GHC parser failed on this input, it is not an Ormolu bug.
10
12
11Parsing of source code failed:
13Parsing of source code failed:
12 src/Language/PureScript/Constants.hs:42:1-15
14 src/Language/PureScript/Constants.hs:42:1-15
13 Invalid type signature: pattern Discard :: ...
15 Invalid type signature: pattern Discard :: ...
14Perhaps you meant to use PatternSynonyms?
16Perhaps you meant to use PatternSynonyms?
17+GHC parser failed on this input, it is not an Ormolu bug.
15
18
16Parsing of source code failed:
19Parsing of source code failed:
17 src/Language/PureScript/Crash.hs:16:1-6
20 src/Language/PureScript/Crash.hs:16:1-6
18 parse error on input `import'
21 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
42 ]
42 ]
43 OrmoluParsingFailed s e ->
43 OrmoluParsingFailed s e ->
44 showParsingErr "Parsing of source code failed:" 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"
45 OrmoluOutputParsingFailed s e ->
46 OrmoluOutputParsingFailed s e ->
46 showParsingErr "Parsing of formatted code failed:" s [e]
47 showParsingErr "Parsing of formatted code failed:" s [e]
47 ++ "Please, consider reporting the bug.\n"
48 ++ "Please, consider reporting the bug.\n"