<bol> {
\n ;
^\# (line)? { begin line_prag1 }
+ ^\# pragma .* \n ; -- GCC 3.3 CPP generated, apparently
() { do_bol }
}
\" { lex_string_tok }
}
-<glaexts> "``" (([$graphic $whitechar] # \') | \' ([$graphic $whitechar] # \'))*
- "''" { clitlit }
-
{
-- work around bug in Alex 2.0
#if __GLASGOW_HASKELL__ < 503
| ITsafe
| ITthreadsafe
| ITunsafe
- | ITwith
| ITstdcallconv
| ITccallconv
| ITdotnet
- | ITccall (Bool,Bool,Safety) -- (is_dyn, is_casm, may_gc)
| ITmdo
| ITspecialise_prag -- Pragmas
| ITprimint Integer
| ITprimfloat Rational
| ITprimdouble Rational
- | ITlitlit FastString
-- MetaHaskell extension tokens
| ITopenExpQuote -- [| or [e|
isSpecial ITsafe = True
isSpecial ITthreadsafe = True
isSpecial ITunsafe = True
-isSpecial ITwith = True
isSpecial ITccallconv = True
isSpecial ITstdcallconv = True
isSpecial ITmdo = True
( "ccall", ITccallconv, bit ffiBit),
( "dotnet", ITdotnet, bit ffiBit),
- ( "with", ITwith, bit withBit),
-
( "rec", ITrec, bit arrowsBit),
- ( "proc", ITproc, bit arrowsBit),
-
- -- On death row
- ("_ccall_", ITccall (False, False, PlayRisky),
- bit glaExtsBit),
- ("_ccall_GC_", ITccall (False, False, PlaySafe False),
- bit glaExtsBit),
- ("_casm_", ITccall (False, True, PlayRisky),
- bit glaExtsBit),
- ("_casm_GC_", ITccall (False, True, PlaySafe False),
- bit glaExtsBit)
+ ( "proc", ITproc, bit arrowsBit)
]
reservedSymsFM = listToUFM $
where go i x | i == len = x
| otherwise = go (i+1) (x * radix + toInteger (to_int (lookAhead buf i)))
-clitlit :: Action
-clitlit loc end buf len =
- return (T loc end (ITlitlit $! lexemeToFastString (stepOnBy 2 buf) (len-4)))
-
-- -----------------------------------------------------------------------------
-- Layout processing
glaExtsBit = 0
ffiBit = 1
parrBit = 2
-withBit = 3
arrowsBit = 4
thBit = 5
ipBit = 6
glaExtsEnabled, ffiEnabled, parrEnabled :: Int -> Bool
glaExtsEnabled flags = testBit flags glaExtsBit
ffiEnabled flags = testBit flags ffiBit
-withEnabled flags = testBit flags withBit
parrEnabled flags = testBit flags parrBit
arrowsEnabled flags = testBit flags arrowsBit
thEnabled flags = testBit flags thBit
where
bitmap = glaExtsBit `setBitIf` dopt Opt_GlasgowExts flags
.|. ffiBit `setBitIf` dopt Opt_FFI flags
- .|. withBit `setBitIf` dopt Opt_With flags
.|. parrBit `setBitIf` dopt Opt_PArr flags
.|. arrowsBit `setBitIf` dopt Opt_Arrows flags
.|. thBit `setBitIf` dopt Opt_TH flags