diff options
| author | simonmar <unknown> | 2004-09-28 09:00:56 +0000 |
|---|---|---|
| committer | simonmar <unknown> | 2004-09-28 09:00:56 +0000 |
| commit | 9ed23db4821edfea91e6b74d71ebc4d1935ec11e (patch) | |
| tree | f0464dc33387e70526c2ac833a037e3a204c484b /ghc/compiler/parser/Lexer.x | |
| parent | b4639cb249f2f904eb78271d0bdedbd90ceb7216 (diff) | |
| download | haskell-9ed23db4821edfea91e6b74d71ebc4d1935ec11e.tar.gz | |
[project @ 2004-09-28 09:00:56 by simonmar]
Ignore RULES pragmas unless we're in -fglasgow-exts mode.
Diffstat (limited to 'ghc/compiler/parser/Lexer.x')
| -rw-r--r-- | ghc/compiler/parser/Lexer.x | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ghc/compiler/parser/Lexer.x b/ghc/compiler/parser/Lexer.x index 8304918114..1d0a5e7bce 100644 --- a/ghc/compiler/parser/Lexer.x +++ b/ghc/compiler/parser/Lexer.x @@ -166,6 +166,14 @@ $white_no_nl+ ; -- NOTE: accept -} at the end of a LINE pragma, for compatibility -- with older versions of GHC which generated these. +-- We only want RULES pragmas to be picked up when -fglasgow-exts +-- is on, because the contents of the pragma is always written using +-- glasgow-exts syntax (using forall etc.), so if glasgow exts are not +-- enabled, we're sure to get a parse error. +-- (ToDo: we should really emit a warning when ignoring pragmas) +<glaexts> + "{-#" $whitechar* (RULES|rules) { token ITrules_prag } + <0,glaexts> { "{-#" $whitechar* (SPECIALI[SZ]E|speciali[sz]e) { token ITspecialise_prag } @@ -173,7 +181,6 @@ $white_no_nl+ ; "{-#" $whitechar* (INLINE|inline) { token ITinline_prag } "{-#" $whitechar* (NO(T?)INLINE|no(t?)inline) { token ITnoinline_prag } - "{-#" $whitechar* (RULES|rules) { token ITrules_prag } "{-#" $whitechar* (DEPRECATED|deprecated) { token ITdeprecated_prag } "{-#" $whitechar* (SCC|scc) { token ITscc_prag } |
