From 03d6ca49a78008d368bed9e7a474d7d7eab4ccc6 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 2 Apr 2017 20:50:58 -0700 Subject: Bugfix: .1 treated as dot if preceded by space. Some recent work in supporting .slot syntax (uref dot) broke the treatment of floating point literals. This is because part of the trick is that a uref dot is recognized with leading whitespace as part of the token. But that of course means it steals the match for some floating-point tokens; oops! * parser.l (grammar): All rules for floating-point tokens which can match a leading decimal point now munch optional whitespace first. --- parser.l | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/parser.l b/parser.l index 418ecc48..fbff9bb4 100644 --- a/parser.l +++ b/parser.l @@ -296,7 +296,7 @@ UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U} return NUMBER; } -{FLO} { +{WS}{FLO} { val str = string_own(utf8_dup_from(yytext)); if (yy_top_state(yyscanner) == INITIAL @@ -308,9 +308,9 @@ UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U} return NUMBER; } -({FLO}|{FLODOT}){TOK} | -({FLO}|{FLODOT}){BTOK} | -({FLO}|{FLODOT}){NTOK} | +{WS}({FLO}|{FLODOT}){TOK} | +{WS}({FLO}|{FLODOT}){BTOK} | +{WS}({FLO}|{FLODOT}){NTOK} | {FLO}[.][^.]? { val str = string_utf8(yytext); -- cgit v1.2.3