From: simonm Date: Tue, 10 Feb 1998 13:47:44 +0000 (+0000) Subject: [project @ 1998-02-10 13:47:44 by simonm] X-Git-Tag: Approx_2487_patches~971 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=ac6352dbd3bbd6a5245f57f965047c0e2c3d59ad;p=ghc-hetmet.git [project @ 1998-02-10 13:47:44 by simonm] Don't do layout processing inside {-# ... #-}. The fix is horrible, and should probably be redone in a cleaner way at some point. --- diff --git a/ghc/compiler/parser/hslexer.flex b/ghc/compiler/parser/hslexer.flex index 432625a..ef02cfd 100644 --- a/ghc/compiler/parser/hslexer.flex +++ b/ghc/compiler/parser/hslexer.flex @@ -315,28 +315,34 @@ NL [\n\r] "{-#"{WS}*"INTERFACE" { PUSH_STATE(UserPragma); + forgetindent = TRUE; RETURN(INTERFACE_UPRAGMA); } "{-#"{WS}*"SPECIALI"[SZ]E { PUSH_STATE(UserPragma); + forgetindent = TRUE; RETURN(SPECIALISE_UPRAGMA); } "{-#"{WS}*"INLINE" { PUSH_STATE(UserPragma); + forgetindent = TRUE; RETURN(INLINE_UPRAGMA); } "{-#"{WS}*"MAGIC_UNFOLDING" { PUSH_STATE(UserPragma); + forgetindent = TRUE; RETURN(MAGIC_UNFOLDING_UPRAGMA); } "{-#"{WS}*"GENERATE_SPECS" { /* these are handled by hscpp */ nested_comments =1; + forgetindent = TRUE; PUSH_STATE(Comment); } "{-#"{WS}*"OPTIONS" { /* these are for the driver! */ nested_comments =1; + forgetindent = TRUE; PUSH_STATE(Comment); } "{-#"{WS}*"SOURCE"{WS}*"#"?"-}" { @@ -355,7 +361,15 @@ NL [\n\r] nested_comments = 1; PUSH_STATE(Comment); } -"#-}" { POP_STATE; RETURN(END_UPRAGMA); } +"#-}" { POP_STATE; + forgetindent=FALSE; + /* don't want any layout processing here, + * so just use 'return' instead of 'RETURN', + * remembering to set hssttok. + */ + hssttok = -1; + return(END_UPRAGMA); + } %{ /*