[project @ 2003-09-24 13:04:45 by simonmar]
[ghc-hetmet.git] / ghc / compiler / parser / Lexer.x
index 0bff597..997a7d7 100644 (file)
@@ -123,6 +123,7 @@ $white_no_nl+                               ;
 <bol> {
   \n                                   ;
   ^\# (line)?                          { begin line_prag1 }
+  ^\# pragma .* \n                     ; -- GCC 3.3 CPP generated, apparently
   ()                                   { do_bol }
 }
 
@@ -287,9 +288,6 @@ $white_no_nl+                               ;
   \"                           { lex_string_tok }
 }
 
-<glaexts> "``" (([$graphic $whitechar] # \') | \' ([$graphic $whitechar] # \'))*
-               "''"            { clitlit }
-
 {
 -- work around bug in Alex 2.0
 #if __GLASGOW_HASKELL__ < 503
@@ -336,11 +334,9 @@ data Token__
   | ITsafe
   | ITthreadsafe
   | ITunsafe
-  | ITwith
   | ITstdcallconv
   | ITccallconv
   | ITdotnet
-  | ITccall (Bool,Bool,Safety) -- (is_dyn, is_casm, may_gc)
   | ITmdo
 
   | ITspecialise_prag          -- Pragmas
@@ -415,7 +411,6 @@ data Token__
   | ITprimint    Integer
   | ITprimfloat  Rational
   | ITprimdouble Rational
-  | ITlitlit     FastString
 
   -- MetaHaskell extension tokens
   | ITopenExpQuote             -- [| or [e|
@@ -459,7 +454,6 @@ isSpecial ITdynamic         = True
 isSpecial ITsafe       = True
 isSpecial ITthreadsafe         = True
 isSpecial ITunsafe     = True
-isSpecial ITwith       = True
 isSpecial ITccallconv   = True
 isSpecial ITstdcallconv = True
 isSpecial ITmdo                = True
@@ -503,9 +497,9 @@ reservedWordsFM = listToUFM $
 
        ( "forall",     ITforall,        bit glaExtsBit),
        ( "mdo",        ITmdo,           bit glaExtsBit),
-       ( "reifyDecl",  ITreifyDecl,     bit glaExtsBit),
-       ( "reifyType",  ITreifyType,     bit glaExtsBit),
-       ( "reifyFixity",ITreifyFixity,   bit glaExtsBit),
+       ( "reifyDecl",  ITreifyDecl,     bit thBit),
+       ( "reifyType",  ITreifyType,     bit thBit),
+       ( "reifyFixity",ITreifyFixity,   bit thBit),
 
        ( "foreign",    ITforeign,       bit ffiBit),
        ( "export",     ITexport,        bit ffiBit),
@@ -518,20 +512,8 @@ reservedWordsFM = listToUFM $
        ( "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 $
@@ -748,10 +730,6 @@ parseInteger buf len radix to_int
   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
 
@@ -1205,7 +1183,6 @@ glaExtsBit, ffiBit, parrBit :: Int
 glaExtsBit = 0
 ffiBit    = 1
 parrBit           = 2
-withBit           = 3
 arrowsBit  = 4
 thBit     = 5
 ipBit      = 6
@@ -1213,7 +1190,6 @@ 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
@@ -1236,7 +1212,6 @@ mkPState buf loc flags  =
     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