From d47f1285fa847ba94e4b6f52934ea6198f6abe2a Mon Sep 17 00:00:00 2001 From: simonmar Date: Wed, 9 Jun 1999 16:14:55 +0000 Subject: [PATCH] [project @ 1999-06-09 16:14:55 by simonmar] - Recognise #-} as the end-of-pragma symbol even when -fglsagow-exts is off. Certain pragmas are Haskell (like {-# OPTIMIZE #-} :-) and some aren't, so we're not really Haskell compliant here. - Fix case-insensitive pragma matching. --- ghc/compiler/parser/Lex.lhs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ghc/compiler/parser/Lex.lhs b/ghc/compiler/parser/Lex.lhs index 43e35b5..b8f2595 100644 --- a/ghc/compiler/parser/Lex.lhs +++ b/ghc/compiler/parser/Lex.lhs @@ -526,9 +526,8 @@ lexToken cont glaexts buf = (_:ctx') -> cont ITccurly (incLexeme buf) s{context=ctx'} _ -> lexError "too many '}'s" buf s - '#'# | flag glaexts - -> case lookAhead# buf 1# of - ')'# -> cont ITcubxparen (setCurrentPos# buf 2#) + '#'# -> case lookAhead# buf 1# of + ')'# | flag glaexts -> cont ITcubxparen (setCurrentPos# buf 2#) '-'# -> case lookAhead# buf 2# of '}'# -> cont ITclose_prag (setCurrentPos# buf 3#) _ -> lex_sym cont (incLexeme buf) @@ -606,7 +605,7 @@ flag _ = True lex_prag cont buf = case expandWhile# is_space buf of { buf1 -> case expandWhile# is_ident (stepOverLexeme buf1) of { buf2 -> - let lexeme = lexemeToFastString buf2 in + let lexeme = mkFastString (map toUpper (lexemeToString buf2)) in case lookupUFM pragmaKeywordsFM lexeme of Just kw -> cont kw (mergeLexemes buf buf2) Nothing -> panic "lex_prag" -- 1.7.10.4