diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-04-02 20:50:58 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-04-02 20:50:58 -0700 |
commit | cd0ac0f7d7ad1012f0eb261dd4b036ff85b95ae2 (patch) | |
tree | 43d4b8486a5988dc00e2dad9de002440ec95152c /parser.l | |
parent | cfce29352e4a2fd05bfb110c0ef49ef760096f69 (diff) | |
download | txr-cd0ac0f7d7ad1012f0eb261dd4b036ff85b95ae2.tar.gz txr-cd0ac0f7d7ad1012f0eb261dd4b036ff85b95ae2.tar.bz2 txr-cd0ac0f7d7ad1012f0eb261dd4b036ff85b95ae2.zip |
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.
Diffstat (limited to 'parser.l')
-rw-r--r-- | parser.l | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -296,7 +296,7 @@ UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U} return NUMBER; } -<SPECIAL,NESTED,BRACED>{FLO} { +<SPECIAL,NESTED,BRACED>{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; } -<SPECIAL>({FLO}|{FLODOT}){TOK} | -<BRACED>({FLO}|{FLODOT}){BTOK} | -<NESTED>({FLO}|{FLODOT}){NTOK} | +<SPECIAL>{WS}({FLO}|{FLODOT}){TOK} | +<BRACED>{WS}({FLO}|{FLODOT}){BTOK} | +<NESTED>{WS}({FLO}|{FLODOT}){NTOK} | <SPECIAL,NESTED,BRACED>{FLO}[.][^.]? { val str = string_utf8(yytext); |