diff options
author | Johan Tibell <johan.tibell@gmail.com> | 2015-01-11 23:19:34 +0100 |
---|---|---|
committer | Johan Tibell <johan.tibell@gmail.com> | 2015-01-11 23:19:34 +0100 |
commit | 1cee34c71e807ff65b921b9062c3d03bac06e01c (patch) | |
tree | 3ff2b46df1ce8e08a1a8800c6a22595504907e82 /compiler/parser | |
parent | 601e345e5df64caa36e7823a6a01cb6c59252c97 (diff) | |
download | haskell-strict-data.tar.gz |
Add Strict data language pragmastrict-data
Diffstat (limited to 'compiler/parser')
-rw-r--r-- | compiler/parser/Parser.y | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index 4958e0c6a3..fb0818c1d5 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -1351,13 +1351,16 @@ sigtypes1 :: { (OrdList (LHsType RdrName)) } -- Always HsForAllTys -- Types strict_mark :: { Located ([AddAnn],HsBang) } - : '!' { sL1 $1 ([], HsSrcBang Nothing True) } - | '{-# UNPACK' '#-}' { sLL $1 $> ([mo $1,mc $2], HsSrcBang (Just True) False) } - | '{-# NOUNPACK' '#-}' { sLL $1 $> ([mo $1,mc $2], HsSrcBang (Just False) False) } - | '{-# UNPACK' '#-}' '!' { sLL $1 $> ([mo $1,mc $2], HsSrcBang (Just True) True) } - | '{-# NOUNPACK' '#-}' '!' { sLL $1 $> ([mo $1,mc $2], HsSrcBang (Just False) True) } - -- Although UNPACK with no '!' is illegal, we get a - -- better error message if we parse it here + : '!' { sL1 $1 ([], HsSrcBang Nothing (Just True)) } + | '~' { sL1 $1 ([], HsSrcBang Nothing (Just False)) } + | '{-# UNPACK' '#-}' { sLL $1 $> ([mo $1,mc $2], HsSrcBang (Just True) Nothing) } + | '{-# NOUNPACK' '#-}' { sLL $1 $> ([mo $1,mc $2], HsSrcBang (Just False) Nothing) } + | '{-# UNPACK' '#-}' '!' { sLL $1 $> ([mo $1,mc $2], HsSrcBang (Just True) (Just True)) } + | '{-# NOUNPACK' '#-}' '!' { sLL $1 $> ([mo $1,mc $2], HsSrcBang (Just False) (Just True)) } + | '{-# UNPACK' '#-}' '~' { sLL $1 $> ([mo $1,mc $2], HsSrcBang (Just True) (Just False)) } + | '{-# NOUNPACK' '#-}' '~' { sLL $1 $> ([mo $1,mc $2], HsSrcBang (Just False) (Just False)) } + -- Although UNPACK with no '!' and UNPACK with '~' are illegal, we get a + -- better error message if we parse them here -- A ctype is a for-all type ctype :: { LHsType RdrName } |