diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-02-26 06:57:47 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-02-26 06:57:47 -0800 |
commit | 0294e98b13a70e91391952e7e24a47407e6d0508 (patch) | |
tree | 1873a42d8e0d840475f56ebbea6609f268e314dc | |
parent | ae24a27bbe4764bc57a64169ecff3cba899efd7b (diff) | |
download | txr-0294e98b13a70e91391952e7e24a47407e6d0508.tar.gz txr-0294e98b13a70e91391952e7e24a47407e6d0508.tar.bz2 txr-0294e98b13a70e91391952e7e24a47407e6d0508.zip |
* parser.y (list): For @n_expr, get the source location info
from the @ token.
(n_expr): Bugfix: do not attribute a symbol with location info.
(quasilit): Obtain location info from quasi_items, and only
if that is unavailable, then from lineno.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | parser.y | 8 |
2 files changed, 13 insertions, 3 deletions
@@ -1,5 +1,13 @@ 2014-02-26 Kaz Kylheku <kaz@kylheku.com> + * parser.y (list): For @n_expr, get the source location info + from the @ token. + (n_expr): Bugfix: do not attribute a symbol with location info. + (quasilit): Obtain location info from quasi_items, and only + if that is unavailable, then from lineno. + +2014-02-26 Kaz Kylheku <kaz@kylheku.com> + Version 81 * txr.c (version): Bumped. @@ -707,9 +707,10 @@ list : '(' n_exprs ')' { $$ = rl($2, num($1)); } | '[' n_exprs ']' { $$ = rl(cons(dwim_s, $2), num($1)); } | '[' ']' { $$ = rl(cons(dwim_s, nil), num($1)); } | '@' n_expr { if (consp($2)) - $$ = rlcp(cons(expr_s, $2), $2); + $$ = rl(cons(expr_s, $2), num($1)); else - $$ = rlcp(cons(var_s, cons($2, nil)), $2); } + $$ = rl(cons(var_s, cons($2, nil)), + num($1)); } | '(' error { $$ = nil; yybadtoken(yychar, lit("list expression")); } | '[' error { $$ = nil; @@ -736,7 +737,7 @@ n_exprs : n_expr { $$ = rlcp(cons($1, nil), $1); } cdr($3)), $1); } ; -n_expr : SYMTOK { $$ = rl(sym_helper($1, t), num(lineno)); } +n_expr : SYMTOK { $$ = sym_helper($1, t); } | METANUM { $$ = cons(var_s, cons($1, nil)); rl($$, num(lineno)); } | NUMBER { $$ = $1; } @@ -890,6 +891,7 @@ chrlit : HASH_BACKSLASH SYMTOK { wchar_t ch; quasilit : '`' '`' { $$ = null_string; } | '`' quasi_items '`' { $$ = cons(quasi_s, o_elems_transform($2)); + rlcp($$, $2); rl($$, num(lineno)); } | '`' error { $$ = nil; yybadtoken(yychar, lit("string literal")); } |