summaryrefslogtreecommitdiff
path: root/compiler/parser/Lexer.x
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2012-06-12 08:42:36 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2012-06-12 08:42:36 +0100
commit4f8e86b44ecc31056d0bd7af325b9bb239ddf7a0 (patch)
tree757ef6b9fc8fc1d38580dda2c2aba7eb142e276b /compiler/parser/Lexer.x
parentad6af5fc6db334a373ef3b7cca72143a8bf6b459 (diff)
downloadhaskell-4f8e86b44ecc31056d0bd7af325b9bb239ddf7a0.tar.gz
Revive 'mdo' expressions, per discussion in Trac #4148
Summary: - mdo expressions are enabled by RecursiveDo pragma - mdo expressions perform full segmentation - 'rec' groups inside 'do' are changed so they do *not* perform any segmentation. - Both 'mdo' and 'rec' are enabled by 'RecursiveDo' 'DoRec' is deprecated in favour of 'RecursiveDo' (The 'rec' keyword is also enabled by 'Arrows', as now.) Thanks to Levent for doing all the work
Diffstat (limited to 'compiler/parser/Lexer.x')
-rw-r--r--compiler/parser/Lexer.x7
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x
index e40f7b2f11..2f9c75ca03 100644
--- a/compiler/parser/Lexer.x
+++ b/compiler/parser/Lexer.x
@@ -658,7 +658,8 @@ reservedWordsFM = listToUFM $
( "capi", ITcapiconv, bit cApiFfiBit),
( "prim", ITprimcallconv, bit ffiBit),
- ( "rec", ITrec, bit recBit),
+ ( "rec", ITrec, bit arrowsBit .|.
+ bit recursiveDoBit),
( "proc", ITproc, bit arrowsBit)
]
@@ -1826,8 +1827,6 @@ inRulePragBit :: Int
inRulePragBit = 19
rawTokenStreamBit :: Int
rawTokenStreamBit = 20 -- producing a token stream with all comments included
-recBit :: Int
-recBit = 22 -- rec
alternativeLayoutRuleBit :: Int
alternativeLayoutRuleBit = 23
relaxedLayoutBit :: Int
@@ -1937,8 +1936,6 @@ mkPState flags buf loc =
.|. magicHashBit `setBitIf` xopt Opt_MagicHash flags
.|. kindSigsBit `setBitIf` xopt Opt_KindSignatures flags
.|. recursiveDoBit `setBitIf` xopt Opt_RecursiveDo flags
- .|. recBit `setBitIf` xopt Opt_DoRec flags
- .|. recBit `setBitIf` xopt Opt_Arrows flags
.|. unicodeSyntaxBit `setBitIf` xopt Opt_UnicodeSyntax flags
.|. unboxedTuplesBit `setBitIf` xopt Opt_UnboxedTuples flags
.|. datatypeContextsBit `setBitIf` xopt Opt_DatatypeContexts flags