diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-04-02 22:25:54 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-04-02 22:25:54 -0700 |
commit | 947b2961479959c79beb8e61a04a6804959dc353 (patch) | |
tree | c141910bce5816fb8bbdd90a0abbcdf1f0005631 | |
parent | 289d2e31bfb8e1d8927a8677de17a6b960d53072 (diff) | |
download | txr-947b2961479959c79beb8e61a04a6804959dc353.tar.gz txr-947b2961479959c79beb8e61a04a6804959dc353.tar.bz2 txr-947b2961479959c79beb8e61a04a6804959dc353.zip |
parser: fix a...b syntax error.
This issue has implications mainly for read/print consistency.
The (rcons a .b) expression prints a...b, but that doesn't
read back. The reason is that the . on .b isn't preceded by
whitespace, and so isn't the UREFDOT token recognized in
a n_expr. It's just the '.' token which is a syntax error
in that situation.
* parser.y (n_expr): New special case rule to handle the
phrase pattern n_expr DOTDOT '.' n_expr which is now
a syntax error.
-rw-r--r-- | parser.y | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -986,6 +986,12 @@ n_expr : SYMTOK { $$ = symhlpr($1, t); } | n_expr DOTDOT n_expr { uses_or2; $$ = rlcp(list(rcons_s, $1, $3, nao), or2($1, $3)); } + | n_expr DOTDOT '.' n_expr + { uses_or2; + $$ = rlcp(list(rcons_s, $1, + uref_helper(parser, $4), + nao), + or2($1, $4)); } | n_expr '.' n_expr { uses_or2; if (consp($3) && car($3) == qref_s) { rplacd($3, rlcp(cons($1, cdr($3)), $1)); |