diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-05-28 05:43:42 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-05-28 05:43:42 -0700 |
commit | c0c5e8836a89c8439a675bbd52d6fed134792477 (patch) | |
tree | 1ab3a2b9301c3d72fac44d1315d5b529d3b259ef /tags.tl | |
parent | b2bedb3c0eae02198678732578db4fa0c0a89fd7 (diff) | |
download | txr-c0c5e8836a89c8439a675bbd52d6fed134792477.tar.gz txr-c0c5e8836a89c8439a675bbd52d6fed134792477.tar.bz2 txr-c0c5e8836a89c8439a675bbd52d6fed134792477.zip |
json: hash issues with quasiquoting.
There are two problems.
One is that in #J{~foo:"bar"} the foo expression is parsed
while the scanner is in Lisp mode and the : token is grabbed
by the parser as a lookahead token in the same mode. Thus it
comes back as a SYMTOK (the colon symbol).
We fix this by recognizing the colon symbol as synonym of
the colon character. But only if it is spelled ":" in
the syntax: we look at the lexeme.
The second problem is that even if we fix the above, ~foo
produces a sys:unquote form which is rejected because it is
not a string. We fix this in the most straightforward way:
by deleting the code which restricts keys to strings,
an extension I already thought about making anyway.
* parser.y (json_col): New non-terminal. This recognizes
either a SYMTOK or a ':' token, with the semantic restriction
that the SYMTOK's lexeme must be ":".
(json_vals): Use yybadtok instead of generic error.
(json_pairs): Do not require keys to be strings. Use json_col
instead of ':', and also yybadtok instead of generic error.
* y.tab.c.shipped: Updated.
Diffstat (limited to 'tags.tl')
0 files changed, 0 insertions, 0 deletions