X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fparser%2FLexer.x;h=11810a60601ce2b3fadc92709f5014d2a46a435a;hb=c71662b207222b409ac678b5e6c55d0fec8df2b7;hp=d1a9bb731cc073c8c69134e4e980864d83eae0a0;hpb=aa13a496c2f4d027355002c7103bc38486497b75;p=ghc-hetmet.git diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index d1a9bb7..11810a6 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -614,7 +614,7 @@ reservedWordsFM = listToUFM $ ( "_scc_", ITscc, 0 ), -- ToDo: remove ( "forall", ITforall, bit tvBit), - ( "mdo", ITmdo, bit glaExtsBit), + ( "mdo", ITmdo, bit recursiveDoBit), ( "family", ITfamily, bit tyFamBit), ( "foreign", ITforeign, bit ffiBit), @@ -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,8 @@ 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 -- Kind signatures on type variables +recursiveDoBit = 13 -- mdo glaExtsEnabled, ffiEnabled, parrEnabled :: Int -> Bool glaExtsEnabled flags = testBit flags glaExtsBit @@ -1531,6 +1533,8 @@ 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 +recursiveDoEnabled flags = testBit flags recursiveDoBit -- PState for parsing options pragmas -- @@ -1583,6 +1587,8 @@ 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 + .|. recursiveDoBit `setBitIf` dopt Opt_RecursiveDo flags -- setBitIf :: Int -> Bool -> Int b `setBitIf` cond | cond = bit b