diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-04-04 19:56:00 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-04-04 19:56:00 -0700 |
commit | d6a92ee6cc6425dbcea2862dccd97f04a80d29f5 (patch) | |
tree | b18c3c652c0e53af51c59473c6f73aa5bc609f61 /configure | |
parent | 93f0e3d10580b0a8126018d0a05dd46b1aa84bf6 (diff) | |
download | txr-d6a92ee6cc6425dbcea2862dccd97f04a80d29f5.tar.gz txr-d6a92ee6cc6425dbcea2862dccd97f04a80d29f5.tar.bz2 txr-d6a92ee6cc6425dbcea2862dccd97f04a80d29f5.zip |
parser: bugfix: don't scan @NUM in QSPECIAL state.
The problem is syntax like `@@12a` being scanned
as if it were `@{@12}a` rather than @{@12a}`.
When the scanner is in the middle of a quasiliteral, in the
QSILIT state and sees a @, it transitions to the QSPECIAL
state.
In the QSPECIAL state, the METANUM token syntax is recognized
consisting of @ followed by a decimal, octal or hex number.
In the same QSPECIAL state, however, a meta-variable like @abc
is not recognized as a unit; rather, a @ is recognized by
itself, and abc by itself. Thus when @12a is seen in the
QSPECIAL state, the @12 is the longest match.
The fix is to treat METANUM tokens the same way in the
QSPECIAL state: just recognize a number without the @
prefix, and report as a METANUM.
* parser.l (grammar): Split the pattern in all four
METANUM rules so that in the NESTED, BRACED,
QSLIT and QWLIT states, the number is recognized
together with the @ prefix. But in the QSPECIAL
state, indicating that one or more @ characters have
been seen, just recognize a number without the prefix
as a METANUM.
Diffstat (limited to 'configure')
0 files changed, 0 insertions, 0 deletions