From: simonmar Date: Mon, 11 Feb 2002 15:23:12 +0000 (+0000) Subject: [project @ 2002-02-11 15:23:12 by simonmar] X-Git-Tag: Approximately_9120_patches~105 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=21e6f1f3370b50fa94a6223b6f213ef125df75e7;p=ghc-hetmet.git [project @ 2002-02-11 15:23:12 by simonmar] Fix lexer bug: we didn't look far enough ahead when parsing 1.0e+x (i.e. the e+x shouldn't be treated as an exponent). --- diff --git a/ghc/compiler/parser/Lex.lhs b/ghc/compiler/parser/Lex.lhs index 01fcc3b..5dd61c3 100644 --- a/ghc/compiler/parser/Lex.lhs +++ b/ghc/compiler/parser/Lex.lhs @@ -925,8 +925,10 @@ lex_num cont exts acc buf = do_exponent = let buf3 = incLexeme buf2 in case currentChar# buf3 of - '-'# -> expandWhile# is_digit (incLexeme buf3) - '+'# -> expandWhile# is_digit (incLexeme buf3) + '-'# | is_digit (lookAhead# buf 1#) + -> expandWhile# is_digit (incLexeme buf3) + '+'# | is_digit (lookAhead# buf 1#) + -> expandWhile# is_digit (incLexeme buf3) x | is_digit x -> expandWhile# is_digit buf3 _ -> buf2