summaryrefslogtreecommitdiff
path: root/compiler/parser
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2007-07-08 12:05:53 +0000
committerIan Lynagh <igloo@earth.li>2007-07-08 12:05:53 +0000
commitc0cc5433a24d5b30de7d6ec6e03480dc9a0958e1 (patch)
tree7b406b9f2c6fd65aab30bb52165a26d1b433cd31 /compiler/parser
parentf4e4060721bdbeee81d5e9fd3c8d909ece6195df (diff)
downloadhaskell-c0cc5433a24d5b30de7d6ec6e03480dc9a0958e1.tar.gz
Implement -XKindSignatures
Diffstat (limited to 'compiler/parser')
-rw-r--r--compiler/parser/Lexer.x5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x
index d1a9bb731c..e008456e7a 100644
--- a/compiler/parser/Lexer.x
+++ b/compiler/parser/Lexer.x
@@ -649,7 +649,7 @@ reservedSymsFM = listToUFM $
,("-", ITminus, 0)
,("!", ITbang, 0)
- ,("*", ITstar, bit glaExtsBit .|.
+ ,("*", ITstar, bit glaExtsBit .|. bit kindSigsBit .|.
bit tyFamBit) -- For data T (a::*) = MkT
,(".", ITdot, bit tvBit) -- For 'forall a . t'
@@ -1518,6 +1518,7 @@ bangPatBit = 8 -- Tells the parser to understand bang-patterns
tyFamBit = 9 -- indexed type families: 'family' keyword and kind sigs
haddockBit = 10 -- Lex and parse Haddock comments
magicHashBit = 11 -- # in both functions and operators
+kindSigsBit = 12 -- # in both functions and operators
glaExtsEnabled, ffiEnabled, parrEnabled :: Int -> Bool
glaExtsEnabled flags = testBit flags glaExtsBit
@@ -1531,6 +1532,7 @@ bangPatEnabled flags = testBit flags bangPatBit
tyFamEnabled flags = testBit flags tyFamBit
haddockEnabled flags = testBit flags haddockBit
magicHashEnabled flags = testBit flags magicHashBit
+kindSigsEnabled flags = testBit flags kindSigsBit
-- PState for parsing options pragmas
--
@@ -1583,6 +1585,7 @@ mkPState buf loc flags =
.|. tyFamBit `setBitIf` dopt Opt_TypeFamilies flags
.|. haddockBit `setBitIf` dopt Opt_Haddock flags
.|. magicHashBit `setBitIf` dopt Opt_MagicHash flags
+ .|. kindSigsBit `setBitIf` dopt Opt_KindSignatures flags
--
setBitIf :: Int -> Bool -> Int
b `setBitIf` cond | cond = bit b