summaryrefslogtreecommitdiff
path: root/testsuite/tests/parser/should_fail
diff options
context:
space:
mode:
authorAlfredo Di Napoli <alfredo@well-typed.com>2021-04-19 14:29:18 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-05-26 16:03:15 -0400
commitcdbce8fc22448837e53515946f16e9571e06f412 (patch)
treea07372a960e55eaeff036ed717272b47f821711b /testsuite/tests/parser/should_fail
parent2023b344a7567492881745609c494a9427dc8c30 (diff)
downloadhaskell-cdbce8fc22448837e53515946f16e9571e06f412.tar.gz
Support new parser types in GHC
This commit converts the lexers and all the parser machinery to use the new parser types and diagnostics infrastructure. Furthermore, it cleans up the way the parser code was emitting hints. As a result of this systematic approach, the test output of the `InfixAppPatErr` and `T984` tests have been changed. Previously they would emit a `SuggestMissingDo` hint, but this was not at all helpful in resolving the error, and it was even confusing by just looking at the original program that triggered the errors. Update haddock submodule
Diffstat (limited to 'testsuite/tests/parser/should_fail')
-rw-r--r--testsuite/tests/parser/should_fail/InfixAppPatErr.stderr1
-rw-r--r--testsuite/tests/parser/should_fail/NoBlockArgumentsFail.stderr5
-rw-r--r--testsuite/tests/parser/should_fail/NoBlockArgumentsFail2.stderr5
-rw-r--r--testsuite/tests/parser/should_fail/NoBlockArgumentsFail3.stderr5
-rw-r--r--testsuite/tests/parser/should_fail/NoBlockArgumentsFailArrowCmds.stderr5
-rw-r--r--testsuite/tests/parser/should_fail/T12429.stderr2
-rw-r--r--testsuite/tests/parser/should_fail/T12610.stderr2
-rw-r--r--testsuite/tests/parser/should_fail/T16270.stderr12
-rw-r--r--testsuite/tests/parser/should_fail/T8501a.stderr5
-rw-r--r--testsuite/tests/parser/should_fail/T8501b.stderr2
-rw-r--r--testsuite/tests/parser/should_fail/T984.stderr1
-rw-r--r--testsuite/tests/parser/should_fail/readFail007.stderr2
-rw-r--r--testsuite/tests/parser/should_fail/readFail040.stderr2
13 files changed, 27 insertions, 22 deletions
diff --git a/testsuite/tests/parser/should_fail/InfixAppPatErr.stderr b/testsuite/tests/parser/should_fail/InfixAppPatErr.stderr
index f50166fd41..4651dae571 100644
--- a/testsuite/tests/parser/should_fail/InfixAppPatErr.stderr
+++ b/testsuite/tests/parser/should_fail/InfixAppPatErr.stderr
@@ -1,4 +1,3 @@
InfixAppPatErr.hs:2:7: error:
do-notation in pattern
- Possibly caused by a missing 'do'?
diff --git a/testsuite/tests/parser/should_fail/NoBlockArgumentsFail.stderr b/testsuite/tests/parser/should_fail/NoBlockArgumentsFail.stderr
index 813271bdb9..bdb3301dea 100644
--- a/testsuite/tests/parser/should_fail/NoBlockArgumentsFail.stderr
+++ b/testsuite/tests/parser/should_fail/NoBlockArgumentsFail.stderr
@@ -2,5 +2,6 @@
NoBlockArgumentsFail.hs:6:17: error:
Unexpected do block in function application:
do return ()
- You could write it with parentheses
- Or perhaps you meant to enable BlockArguments?
+ Suggested fixes:
+ Use parentheses.
+ Perhaps you intended to use BlockArguments
diff --git a/testsuite/tests/parser/should_fail/NoBlockArgumentsFail2.stderr b/testsuite/tests/parser/should_fail/NoBlockArgumentsFail2.stderr
index 0361369774..5b3a697f2e 100644
--- a/testsuite/tests/parser/should_fail/NoBlockArgumentsFail2.stderr
+++ b/testsuite/tests/parser/should_fail/NoBlockArgumentsFail2.stderr
@@ -2,5 +2,6 @@
NoBlockArgumentsFail2.hs:6:22: error:
Unexpected lambda expression in function application:
\ x -> print x
- You could write it with parentheses
- Or perhaps you meant to enable BlockArguments?
+ Suggested fixes:
+ Use parentheses.
+ Perhaps you intended to use BlockArguments
diff --git a/testsuite/tests/parser/should_fail/NoBlockArgumentsFail3.stderr b/testsuite/tests/parser/should_fail/NoBlockArgumentsFail3.stderr
index e285e6ea72..93a3c99d49 100644
--- a/testsuite/tests/parser/should_fail/NoBlockArgumentsFail3.stderr
+++ b/testsuite/tests/parser/should_fail/NoBlockArgumentsFail3.stderr
@@ -2,5 +2,6 @@
NoBlockArgumentsFail3.hs:7:22: error:
Unexpected lambda-case expression in function application:
\case Just 3 -> print x
- You could write it with parentheses
- Or perhaps you meant to enable BlockArguments?
+ Suggested fixes:
+ Use parentheses.
+ Perhaps you intended to use BlockArguments
diff --git a/testsuite/tests/parser/should_fail/NoBlockArgumentsFailArrowCmds.stderr b/testsuite/tests/parser/should_fail/NoBlockArgumentsFailArrowCmds.stderr
index 2a99cda137..504f4c738f 100644
--- a/testsuite/tests/parser/should_fail/NoBlockArgumentsFailArrowCmds.stderr
+++ b/testsuite/tests/parser/should_fail/NoBlockArgumentsFailArrowCmds.stderr
@@ -2,5 +2,6 @@
NoBlockArgumentsFailArrowCmds.hs:7:27: error:
Unexpected lambda command in function application:
\ () -> () >- returnA
- You could write it with parentheses
- Or perhaps you meant to enable BlockArguments?
+ Suggested fixes:
+ Use parentheses.
+ Perhaps you intended to use BlockArguments
diff --git a/testsuite/tests/parser/should_fail/T12429.stderr b/testsuite/tests/parser/should_fail/T12429.stderr
index e29388f3e5..eab51a5646 100644
--- a/testsuite/tests/parser/should_fail/T12429.stderr
+++ b/testsuite/tests/parser/should_fail/T12429.stderr
@@ -1,4 +1,4 @@
T12429.hs:2:29: error:
parse error on input ‘Y’
- Perhaps you intended to use PatternSynonyms
+ Suggested fix: Perhaps you intended to use PatternSynonyms
diff --git a/testsuite/tests/parser/should_fail/T12610.stderr b/testsuite/tests/parser/should_fail/T12610.stderr
index 29d9b26cf2..2eb924bfb0 100644
--- a/testsuite/tests/parser/should_fail/T12610.stderr
+++ b/testsuite/tests/parser/should_fail/T12610.stderr
@@ -1,6 +1,6 @@
T12610.hs:5:1: warning: [-Wtabs (in -Wdefault)]
Tab character found here.
- Please use spaces instead.
+ Suggested fix: Please use spaces instead.
T12610.hs:5:9: parse error on input ‘y’
diff --git a/testsuite/tests/parser/should_fail/T16270.stderr b/testsuite/tests/parser/should_fail/T16270.stderr
index 323d9c93e3..40a986879e 100644
--- a/testsuite/tests/parser/should_fail/T16270.stderr
+++ b/testsuite/tests/parser/should_fail/T16270.stderr
@@ -4,7 +4,7 @@ T16270.hs:3:13: warning: [-Wdeprecated-flags (in -Wdefault)]
T16270.hs:8:1: warning: [-Wtabs (in -Wdefault)]
Tab character found here, and in five further locations.
- Please use spaces instead.
+ Suggested fix: Please use spaces instead.
T16270.hs:8:12: error:
Unexpected semi-colons in conditional:
@@ -14,14 +14,16 @@ T16270.hs:8:12: error:
T16270.hs:13:8: error:
Unexpected do block in function application:
do 1
- You could write it with parentheses
- Or perhaps you meant to enable BlockArguments?
+ Suggested fixes:
+ Use parentheses.
+ Perhaps you intended to use BlockArguments
T16270.hs:14:8: error:
Unexpected lambda expression in function application:
\ x -> x
- You could write it with parentheses
- Or perhaps you meant to enable BlockArguments?
+ Suggested fixes:
+ Use parentheses.
+ Perhaps you intended to use BlockArguments
T16270.hs:18:22: error:
Illegal record syntax (use TraditionalRecordSyntax): {fst :: a,
diff --git a/testsuite/tests/parser/should_fail/T8501a.stderr b/testsuite/tests/parser/should_fail/T8501a.stderr
index 44431fca77..1c899e8bca 100644
--- a/testsuite/tests/parser/should_fail/T8501a.stderr
+++ b/testsuite/tests/parser/should_fail/T8501a.stderr
@@ -1,5 +1,6 @@
T8501a.hs:5:3: error:
Parse error in pattern: rec
- Possibly caused by a missing 'do'?
- Perhaps you intended to use RecursiveDo
+ Suggested fixes:
+ Perhaps you intended to use RecursiveDo
+ Possibly caused by a missing 'do'?
diff --git a/testsuite/tests/parser/should_fail/T8501b.stderr b/testsuite/tests/parser/should_fail/T8501b.stderr
index e9e4b5ec91..15a631c177 100644
--- a/testsuite/tests/parser/should_fail/T8501b.stderr
+++ b/testsuite/tests/parser/should_fail/T8501b.stderr
@@ -1,4 +1,4 @@
T8501b.hs:5:9: error:
parse error on input ‘<-’
- Perhaps you intended to use RecursiveDo
+ Suggested fix: Perhaps you intended to use RecursiveDo
diff --git a/testsuite/tests/parser/should_fail/T984.stderr b/testsuite/tests/parser/should_fail/T984.stderr
index 6d25a36e9e..aaa4f532a9 100644
--- a/testsuite/tests/parser/should_fail/T984.stderr
+++ b/testsuite/tests/parser/should_fail/T984.stderr
@@ -1,4 +1,3 @@
T984.hs:6:9: error:
(case ... of ...)-syntax in pattern
- Possibly caused by a missing 'do'?
diff --git a/testsuite/tests/parser/should_fail/readFail007.stderr b/testsuite/tests/parser/should_fail/readFail007.stderr
index bd6d92ed58..ab4140f52a 100644
--- a/testsuite/tests/parser/should_fail/readFail007.stderr
+++ b/testsuite/tests/parser/should_fail/readFail007.stderr
@@ -1,4 +1,4 @@
readFail007.hs:6:4:
Parse error in pattern: 2 + 2
- Possibly caused by a missing 'do'?
+ Suggested fix: Possibly caused by a missing 'do'?
diff --git a/testsuite/tests/parser/should_fail/readFail040.stderr b/testsuite/tests/parser/should_fail/readFail040.stderr
index 663220da26..3ba58a4adb 100644
--- a/testsuite/tests/parser/should_fail/readFail040.stderr
+++ b/testsuite/tests/parser/should_fail/readFail040.stderr
@@ -1,4 +1,4 @@
readFail040.hs:7:11: error:
parse error on input ‘<-’
- Perhaps you intended to use RecursiveDo
+ Suggested fix: Perhaps you intended to use RecursiveDo