Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
c71662b2
Commit
c71662b2
authored
Jul 08, 2007
by
Ian Lynagh
Browse files
Implement -XRecursiveDo
parent
922de8ca
Changes
2
Hide whitespace changes
Inline
Side-by-side
compiler/main/DynFlags.hs
View file @
c71662b2
...
...
@@ -189,6 +189,7 @@ data DynFlag
|
Opt_KindSignatures
|
Opt_ParallelListComp
|
Opt_GeneralizedNewtypeDeriving
|
Opt_RecursiveDo
-- optimisation opts
|
Opt_Strictness
...
...
@@ -1106,6 +1107,7 @@ xFlags = [
(
"FFI"
,
Opt_FFI
),
-- ...and also `-fffi'
(
"ForeignFunctionInterface"
,
Opt_FFI
),
(
"RecursiveDo"
,
Opt_RecursiveDo
),
(
"Arrows"
,
Opt_Arrows
),
-- arrow syntax
(
"Parr"
,
Opt_PArr
),
...
...
@@ -1149,6 +1151,7 @@ glasgowExtsFlags = [ Opt_GlasgowExts
,
Opt_ScopedTypeVariables
,
Opt_MultiParamTypeClasses
,
Opt_MagicHash
,
Opt_RecursiveDo
,
Opt_ParallelListComp
,
Opt_EmptyDataDecls
,
Opt_KindSignatures
...
...
compiler/parser/Lexer.x
View file @
c71662b2
...
...
@@ -614,7 +614,7 @@ reservedWordsFM = listToUFM $
( "_scc_", ITscc, 0 ), -- ToDo: remove
( "forall", ITforall, bit tvBit),
( "mdo", ITmdo, bit
glaExts
Bit),
( "mdo", ITmdo, bit
recursiveDo
Bit),
( "family", ITfamily, bit tyFamBit),
( "foreign", ITforeign, bit ffiBit),
...
...
@@ -1518,7 +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 -- # 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
...
...
@@ -1533,6 +1534,7 @@ 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
--
...
...
@@ -1586,6 +1588,7 @@ mkPState buf loc 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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment