Alan Zimmerman pushed to branch wip/az/ghc-cpp at Glasgow Haskell Compiler / GHC

Commits:

2 changed files:

Changes:

  • compiler/GHC/Parser/Lexer.x
    ... ... @@ -333,7 +333,7 @@ $unigraphic / { isSmartQuote } { smart_quote_error }
    333 333
       ^\# line                              { begin line_prag1 }
    
    334 334
       ^\# / { followedByDigit }             { begin line_prag1 }
    
    335 335
     
    
    336
    -  ^\ *\# \ * $idchar+ .*\n   / { ifExtensionGhcCppNotComment } { cppSkip }
    
    336
    +  ^\# \ * $idchar+ .*\n   / { ifExtensionGhcCppNotComment } { cppSkip } -- No leading space, otherwise clashes with OverloadedLabels
    
    337 337
     
    
    338 338
       ^\# pragma .* \n     / { ifExtensionGhcCppNotComment } { cppSkip } -- GCC 3.3 CPP generated, apparently
    
    339 339
       ^\# \! .* \n         / { ifExtensionGhcCppNotComment } { cppSkip } -- #!, for scripts  -- gcc
    

  • utils/check-cpp/Main.hs
    ... ... @@ -147,8 +147,8 @@ getPState dflags includes popts filename str = pstate
    147 147
                 , pp_defines = predefinedMacros dflags
    
    148 148
                 , pp_scope = (PpScope True PpNoGroup) :| []
    
    149 149
                 }
    
    150
    -    -- pstate = Lexer.initParserState initState popts buf loc
    
    151
    -    pstate = Lexer.initPragState initState popts buf loc
    
    150
    +    pstate = Lexer.initParserState initState popts buf loc
    
    151
    +    -- pstate = Lexer.initPragState initState popts buf loc
    
    152 152
         loc = mkRealSrcLoc (mkFastString filename) 1 1
    
    153 153
         buf = stringToStringBuffer str
    
    154 154
     
    
    ... ... @@ -598,7 +598,7 @@ t20 :: IO ()
    598 598
     t20 = do
    
    599 599
         dump
    
    600 600
             [ "{-# LANGUAGE CPP #-}"
    
    601
    -        , "#if __GLASGOW_HASKELL__ >= 913"
    
    601
    +        , "#if __GLASGOW_HASKELL__ > 913"
    
    602 602
             , "{-# LANGUAGE GHC_CPP #-}"
    
    603 603
             , "#endif"
    
    604 604
             , ""