diff options
author | Joshua Price <2855417+ElderEphemera@users.noreply.github.com> | 2020-05-23 20:28:13 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-05-24 15:22:56 -0400 |
commit | cd339ef0e8ce940902df79ed1d93b3af50ea6f77 (patch) | |
tree | df919017bf2f813a3e07f936c08366d708b3bf87 /testsuite | |
parent | b420fb2474650e6dfbd66afd199f28492f900f75 (diff) | |
download | haskell-cd339ef0e8ce940902df79ed1d93b3af50ea6f77.tar.gz |
Make Unicode brackets opening/closing tokens (#18225)
The tokens `[|`, `|]`, `(|`, and `|)` are opening/closing tokens as
described in GHC Proposal #229. This commit makes the unicode
variants (`⟦`, `⟧`, `⦇`, and `⦈`) act the same as their ASCII
counterparts.
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/parser/unicode/T18225A.hs | 13 | ||||
-rw-r--r-- | testsuite/tests/parser/unicode/T18225B.hs | 11 | ||||
-rw-r--r-- | testsuite/tests/parser/unicode/T18225B.stderr | 1 | ||||
-rw-r--r-- | testsuite/tests/parser/unicode/all.T | 2 |
4 files changed, 27 insertions, 0 deletions
diff --git a/testsuite/tests/parser/unicode/T18225A.hs b/testsuite/tests/parser/unicode/T18225A.hs new file mode 100644 index 0000000000..5e340a3fe6 --- /dev/null +++ b/testsuite/tests/parser/unicode/T18225A.hs @@ -0,0 +1,13 @@ +{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE UnicodeSyntax #-} + +module T18225A where + +(!) :: IO a -> b -> b +(!) _ = id + +test1 :: Int +test1 = $⟦1⟧ + +test2 :: Int +test2 = ⟦2⟧!2 diff --git a/testsuite/tests/parser/unicode/T18225B.hs b/testsuite/tests/parser/unicode/T18225B.hs new file mode 100644 index 0000000000..5bd15f1e13 --- /dev/null +++ b/testsuite/tests/parser/unicode/T18225B.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE Arrows #-} +{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE UnicodeSyntax #-} + +module T18225B where + +f :: (a, (b, c)) -> b +f (_, (x, _)) = x + +test :: a -> a +test = proc x -> ⦇f⦈$([|x|]) diff --git a/testsuite/tests/parser/unicode/T18225B.stderr b/testsuite/tests/parser/unicode/T18225B.stderr new file mode 100644 index 0000000000..67cff08f21 --- /dev/null +++ b/testsuite/tests/parser/unicode/T18225B.stderr @@ -0,0 +1 @@ +T18225B.hs:11:23: Parse error in command: [| x |] diff --git a/testsuite/tests/parser/unicode/all.T b/testsuite/tests/parser/unicode/all.T index 55f7fd09be..54a3b7cb1f 100644 --- a/testsuite/tests/parser/unicode/all.T +++ b/testsuite/tests/parser/unicode/all.T @@ -28,3 +28,5 @@ test('T10907', normal, compile, ['']) test('T7650', normal, compile, ['']) test('brackets', normal, compile, ['']) +test('T18225A', normal, compile, ['']) +test('T18225B', normal, compile_fail, ['']) |