[commit: ghc] master: Fix #5682. Now, '(:) parses. (473f12a)

git at git.haskell.org git at git.haskell.org
Thu Feb 13 23:10:07 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/473f12a3be27a00b035f1fdc7050a0ff31bf12ff/ghc

>---------------------------------------------------------------

commit 473f12a3be27a00b035f1fdc7050a0ff31bf12ff
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date:   Thu Feb 13 13:35:40 2014 -0500

    Fix #5682. Now, '(:) parses.


>---------------------------------------------------------------

473f12a3be27a00b035f1fdc7050a0ff31bf12ff
 compiler/parser/Parser.y.pp                    |    2 ++
 testsuite/tests/parser/should_compile/T5682.hs |   12 ++++++++++++
 testsuite/tests/parser/should_compile/all.T    |    1 +
 3 files changed, 15 insertions(+)

diff --git a/compiler/parser/Parser.y.pp b/compiler/parser/Parser.y.pp
index 1715f6c..d2bc463 100644
--- a/compiler/parser/Parser.y.pp
+++ b/compiler/parser/Parser.y.pp
@@ -1155,6 +1155,8 @@ atype :: { LHsType RdrName }
         | SIMPLEQUOTE  '(' ')'                        { LL $ HsTyVar $ getRdrName unitDataCon }
         | SIMPLEQUOTE  '(' ctype ',' comma_types1 ')' { LL $ HsExplicitTupleTy [] ($3 : $5) }
         | SIMPLEQUOTE  '[' comma_types0 ']'           { LL $ HsExplicitListTy placeHolderKind $3 }
+        | SIMPLEQUOTE '(' qconop ')'                  { LL $ HsTyVar (unLoc $3) }
+        | SIMPLEQUOTE '(' varop  ')'                  { LL $ HsTyVar (unLoc $3) }
         | '[' ctype ',' comma_types1 ']'              { LL $ HsExplicitListTy placeHolderKind ($2 : $4) }
         | INTEGER            {% mkTyLit $ LL $ HsNumTy $ getINTEGER $1 }
         | STRING             {% mkTyLit $ LL $ HsStrTy $ getSTRING  $1 }
diff --git a/testsuite/tests/parser/should_compile/T5682.hs b/testsuite/tests/parser/should_compile/T5682.hs
new file mode 100644
index 0000000..bfd6752
--- /dev/null
+++ b/testsuite/tests/parser/should_compile/T5682.hs
@@ -0,0 +1,12 @@
+{-# LANGUAGE DataKinds, DeriveDataTypeable, StandaloneDeriving, TypeOperators #-}
+
+module T5682 where
+
+import Data.Typeable
+
+data a :+: b = Mk a b
+data Foo = Bool :+: Bool
+
+type X = True ':+: False
+
+deriving instance Typeable '(:+:)
\ No newline at end of file
diff --git a/testsuite/tests/parser/should_compile/all.T b/testsuite/tests/parser/should_compile/all.T
index 1129856..e9cc99e 100644
--- a/testsuite/tests/parser/should_compile/all.T
+++ b/testsuite/tests/parser/should_compile/all.T
@@ -96,3 +96,4 @@ test('T5243', extra_clean(['T5243A.hi', 'T5243A.o']),
      multimod_compile, ['T5243',''])
 test('T7118', normal, compile, [''])
 test('T7776', normal, compile, [''])
+test('T5682', normal, compile, [''])
\ No newline at end of file



More information about the ghc-commits mailing list