From: Ian Lynagh Date: Tue, 6 Jul 2010 17:30:07 +0000 (+0000) Subject: Make pragState call mkPState, rather than duplicating everything X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=847d3977929216f2484ed6ae33112b74fc86776a;hp=e553a60151dc282c8b8c201871212cba0c3bf2a0 Make pragState call mkPState, rather than duplicating everything This also means that extsBitmap gets set, whereas is was just being set to 0 before. --- diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index 4e96176..4ce8304 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -1794,25 +1794,9 @@ alternativeLayoutRule flags = testBit flags alternativeLayoutRuleBit -- PState for parsing options pragmas -- pragState :: DynFlags -> StringBuffer -> SrcLoc -> PState -pragState dynflags buf loc = - PState { - buffer = buf, - messages = emptyMessages, - dflags = dynflags, - last_loc = mkSrcSpan loc loc, - last_len = 0, - loc = loc, - extsBitmap = 0, - context = [], - lex_state = [bol, option_prags, 0], - alr_pending_implicit_tokens = [], - alr_next_token = Nothing, - alr_last_loc = noSrcSpan, - alr_context = [], - alr_expecting_ocurly = Nothing, - alr_justClosedExplicitLetBlock = False - } - +pragState dynflags buf loc = (mkPState dynflags buf loc) { + lex_state = [bol, option_prags, 0] + } -- create a parse state --