diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-04-02 21:07:18 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-04-02 21:07:18 -0700 |
commit | f97195a85409041f9dae13b630e9e2a6418c3cb1 (patch) | |
tree | 2662547031b75455c17a6a550d6636a915a9fd69 /parser.l | |
parent | cd0ac0f7d7ad1012f0eb261dd4b036ff85b95ae2 (diff) | |
download | txr-f97195a85409041f9dae13b630e9e2a6418c3cb1.tar.gz txr-f97195a85409041f9dae13b630e9e2a6418c3cb1.tar.bz2 txr-f97195a85409041f9dae13b630e9e2a6418c3cb1.zip |
parser: diagnose syntax like 0.1.2 and .1.1.
Currently (list .1.1) yields (0.1 0.1). This is evading the
rule for catching cramped floating-point literals.
* parser.l (grammar): Carefully weaken the pattern match in
the relevant rule for catching cramped floating-point
literals, so it matches these cases.
Diffstat (limited to 'parser.l')
-rw-r--r-- | parser.l | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -308,9 +308,9 @@ UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U} return NUMBER; } -<SPECIAL>{WS}({FLO}|{FLODOT}){TOK} | -<BRACED>{WS}({FLO}|{FLODOT}){BTOK} | -<NESTED>{WS}({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); |