From 394ecfc54e4b77df95812aec2e83e3003d0fe0bd Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Tue, 10 Jul 2007 20:21:29 +0000 Subject: [PATCH] {| and |} are -fgenerics syntax --- compiler/parser/Lexer.x | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index 0a8c410..ac61715 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -316,9 +316,9 @@ $tab+ { warn Opt_WarnTabs (text "Tab character") } { token ITcubxparen } } - { - "{|" { token ITocurlybar } - "|}" { token ITccurlybar } +<0,glaexts> { + "{|" / { ifExtension genericsEnabled } { token ITocurlybar } + "|}" / { ifExtension genericsEnabled } { token ITccurlybar } } <0,option_prags,glaexts> { @@ -1532,6 +1532,7 @@ kindSigsBit = 12 -- Kind signatures on type variables recursiveDoBit = 13 -- mdo unicodeSyntaxBit = 14 -- the forall symbol, arrow symbols, etc unboxedTuplesBit = 15 -- (# and #) +genericsBit = 16 -- {| and |} glaExtsEnabled, ffiEnabled, parrEnabled :: Int -> Bool always _ = True @@ -1550,6 +1551,7 @@ kindSigsEnabled flags = testBit flags kindSigsBit recursiveDoEnabled flags = testBit flags recursiveDoBit unicodeSyntaxEnabled flags = testBit flags unicodeSyntaxBit unboxedTuplesEnabled flags = testBit flags unboxedTuplesBit +genericsEnabled flags = testBit flags genericsBit -- PState for parsing options pragmas -- @@ -1610,6 +1612,7 @@ mkPState buf loc flags = .|. recursiveDoBit `setBitIf` dopt Opt_RecursiveDo flags .|. unicodeSyntaxBit `setBitIf` dopt Opt_UnicodeSyntax flags .|. unboxedTuplesBit `setBitIf` dopt Opt_UnboxedTuples flags + .|. genericsBit `setBitIf` dopt Opt_Generics flags -- setBitIf :: Int -> Bool -> Int b `setBitIf` cond | cond = bit b -- 1.7.10.4