summaryrefslogtreecommitdiff
path: root/testsuite/tests/parser
diff options
context:
space:
mode:
authorAlec Theriault <alec.theriault@gmail.com>2019-02-25 16:39:27 -0800
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-03-01 16:32:09 -0500
commitf37efb11b957a21f3048f7005a234f96350ff938 (patch)
tree806f2937aa38e50ec4e9f3ba1949a15a35b7ca21 /testsuite/tests/parser
parentc26d299dc422f43b8c37da4b26da2067eedcbae8 (diff)
downloadhaskell-f37efb11b957a21f3048f7005a234f96350ff938.tar.gz
Lexer: turn some fatal errors into non-fatal ones
The following previously fatal lexer errors are now non-fatal: * errors about enabling `LambdaCase` * errors about enabling `NumericUnderscores` * errors about having valid characters in primitive strings See #16270
Diffstat (limited to 'testsuite/tests/parser')
-rw-r--r--testsuite/tests/parser/should_fail/ParserNoLambdaCase.stderr2
-rw-r--r--testsuite/tests/parser/should_fail/T16270.hs9
-rw-r--r--testsuite/tests/parser/should_fail/T16270.stderr10
3 files changed, 18 insertions, 3 deletions
diff --git a/testsuite/tests/parser/should_fail/ParserNoLambdaCase.stderr b/testsuite/tests/parser/should_fail/ParserNoLambdaCase.stderr
index 24d5cfc168..601262c360 100644
--- a/testsuite/tests/parser/should_fail/ParserNoLambdaCase.stderr
+++ b/testsuite/tests/parser/should_fail/ParserNoLambdaCase.stderr
@@ -1,2 +1,2 @@
ParserNoLambdaCase.hs:3:6:
- Illegal lambda-case (use -XLambdaCase)
+ Illegal lambda-case (use LambdaCase)
diff --git a/testsuite/tests/parser/should_fail/T16270.hs b/testsuite/tests/parser/should_fail/T16270.hs
index 0c5166d402..0147f9776a 100644
--- a/testsuite/tests/parser/should_fail/T16270.hs
+++ b/testsuite/tests/parser/should_fail/T16270.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE NoTraditionalRecordSyntax, NoDoAndIfThenElse, NoMultiWayIf #-}
+{-# LANGUAGE NoTraditionalRecordSyntax, NoDoAndIfThenElse, NoMultiWayIf, NoLambdaCase, NoNumericUnderscores, MagicHash #-}
{-# OPTIONS -Werror=missing-space-after-bang #-}
module T16270 where
@@ -29,6 +29,13 @@ multiWayIf !i = (a, b)
b = if | i -> False
| otherwise -> True
+w = \case _ : _ -> True
+ _ -> False
+
+n = 123_456
+
+s = "hello ωorld"# -- note the omega
+
-- a fatal error.
k = let
diff --git a/testsuite/tests/parser/should_fail/T16270.stderr b/testsuite/tests/parser/should_fail/T16270.stderr
index 7eccd9516e..f4e90e40fc 100644
--- a/testsuite/tests/parser/should_fail/T16270.stderr
+++ b/testsuite/tests/parser/should_fail/T16270.stderr
@@ -57,5 +57,13 @@ T16270.hs:27:9: error:
T16270.hs:29:9: error:
Multi-way if-expressions need MultiWayIf turned on
-T16270.hs:36:1: error:
+T16270.hs:32:6: Illegal lambda-case (use LambdaCase)
+
+T16270.hs:35:5:
+ Use NumericUnderscores to allow underscores in integer literals
+
+T16270.hs:37:5:
+ primitive string literal must contain only characters <= '/xFF'
+
+T16270.hs:43:1: error:
parse error (possibly incorrect indentation or mismatched brackets)