X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fparser%2FLexer.x;h=4e9617602280fe2cf5dac5fb4b032e3fdf9124b1;hp=2cd0a82a7223a1999f973e2995578eedd03abc5a;hb=b017f34bebf1588e5e579d7c653413e2a4c2d170;hpb=8354d614a5287753710a4cccd202f74f094c99c4 diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index 2cd0a82..4e96176 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -1816,8 +1816,8 @@ pragState dynflags buf loc = -- create a parse state -- -mkPState :: StringBuffer -> SrcLoc -> DynFlags -> PState -mkPState buf loc flags = +mkPState :: DynFlags -> StringBuffer -> SrcLoc -> PState +mkPState flags buf loc = PState { buffer = buf, dflags = flags, @@ -1828,7 +1828,6 @@ mkPState buf loc flags = extsBitmap = fromIntegral bitmap, context = [], lex_state = [bol, 0], - -- we begin in the layout state if toplev_layout is set alr_pending_implicit_tokens = [], alr_next_token = Nothing, alr_last_loc = noSrcSpan, @@ -2202,7 +2201,8 @@ reportLexError loc1 loc2 buf str lexTokenStream :: StringBuffer -> SrcLoc -> DynFlags -> ParseResult [Located Token] lexTokenStream buf loc dflags = unP go initState - where initState = mkPState buf loc (dopt_set (dopt_unset dflags Opt_Haddock) Opt_KeepRawTokenStream) + where dflags' = dopt_set (dopt_unset dflags Opt_Haddock) Opt_KeepRawTokenStream + initState = mkPState dflags' buf loc go = do ltok <- lexer return case ltok of