From a52dc4b852e433d00aa1c79acc41bb92f39e66d7 Mon Sep 17 00:00:00 2001 From: simonmar Date: Tue, 2 Jan 2001 14:02:16 +0000 Subject: [PATCH] [project @ 2001-01-02 14:02:16 by simonmar] Be a bit stricter about what we treat as a #line pragma. --- ghc/compiler/parser/Lex.lhs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ghc/compiler/parser/Lex.lhs b/ghc/compiler/parser/Lex.lhs index def163d..3ff951a 100644 --- a/ghc/compiler/parser/Lex.lhs +++ b/ghc/compiler/parser/Lex.lhs @@ -448,7 +448,11 @@ lexer cont buf s@(PState{ -- special GHC extension: we grok cpp-style #line pragmas '#'# | lexemeIndex buf ==# bol -> -- the '#' must be in column 0 - line_prag next_line (stepOn buf) s' + case expandWhile# is_space (stepOn buf) of { buf1 -> + if is_digit (currentChar# buf1) + then line_prag next_line buf1 s' + else is_a_token + } where next_line buf = lexer cont (stepOnUntilChar# buf '\n'#) -- 1.7.10.4