summaryrefslogtreecommitdiffstats
path: root/parser.y
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-02-26 06:57:47 -0800
committerKaz Kylheku <kaz@kylheku.com>2014-02-26 06:57:47 -0800
commit0294e98b13a70e91391952e7e24a47407e6d0508 (patch)
tree1873a42d8e0d840475f56ebbea6609f268e314dc /parser.y
parentae24a27bbe4764bc57a64169ecff3cba899efd7b (diff)
downloadtxr-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.
Diffstat (limited to 'parser.y')
-rw-r--r--parser.y8
1 files changed, 5 insertions, 3 deletions
diff --git a/parser.y b/parser.y
index 87c356a1..396d097f 100644
--- a/parser.y
+++ b/parser.y
@@ -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")); }