From 21e6f1f3370b50fa94a6223b6f213ef125df75e7 Mon Sep 17 00:00:00 2001 From: simonmar Date: Mon, 11 Feb 2002 15:23:12 +0000 Subject: [PATCH] [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). --- ghc/compiler/parser/Lex.lhs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 -- 1.7.10.4