[Git][ghc/ghc][wip/az/ghc-cpp] 2 commits: Tweak testing

Alan Zimmerman pushed to branch wip/az/ghc-cpp at Glasgow Haskell Compiler / GHC Commits: e14f9dfc by Alan Zimmerman at 2025-05-25T18:15:19+01:00 Tweak testing - - - - - 3e7ac77b by Alan Zimmerman at 2025-05-25T18:15:35+01:00 Only allow unknown cpp pragmas with # in left margin - - - - - 2 changed files: - compiler/GHC/Parser/Lexer.x - utils/check-cpp/Main.hs Changes: ===================================== compiler/GHC/Parser/Lexer.x ===================================== @@ -333,7 +333,7 @@ $unigraphic / { isSmartQuote } { smart_quote_error } ^\# line { begin line_prag1 } ^\# / { followedByDigit } { begin line_prag1 } - ^\ *\# \ * $idchar+ .*\n / { ifExtensionGhcCppNotComment } { cppSkip } + ^\# \ * $idchar+ .*\n / { ifExtensionGhcCppNotComment } { cppSkip } -- No leading space, otherwise clashes with OverloadedLabels ^\# pragma .* \n / { ifExtensionGhcCppNotComment } { cppSkip } -- GCC 3.3 CPP generated, apparently ^\# \! .* \n / { ifExtensionGhcCppNotComment } { cppSkip } -- #!, for scripts -- gcc ===================================== utils/check-cpp/Main.hs ===================================== @@ -147,8 +147,8 @@ getPState dflags includes popts filename str = pstate , pp_defines = predefinedMacros dflags , pp_scope = (PpScope True PpNoGroup) :| [] } - -- pstate = Lexer.initParserState initState popts buf loc - pstate = Lexer.initPragState initState popts buf loc + pstate = Lexer.initParserState initState popts buf loc + -- pstate = Lexer.initPragState initState popts buf loc loc = mkRealSrcLoc (mkFastString filename) 1 1 buf = stringToStringBuffer str @@ -598,7 +598,7 @@ t20 :: IO () t20 = do dump [ "{-# LANGUAGE CPP #-}" - , "#if __GLASGOW_HASKELL__ >= 913" + , "#if __GLASGOW_HASKELL__ > 913" , "{-# LANGUAGE GHC_CPP #-}" , "#endif" , "" View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c5ad6c90dc6932f48b8316e3637a66a... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c5ad6c90dc6932f48b8316e3637a66a... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Alan Zimmerman (@alanz)