Skip to content
Snippets Groups Projects
Commit d47f1285 authored by Simon Marlow's avatar Simon Marlow
Browse files

[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.
parent 3505f69a
No related merge requests found
......@@ -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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment