summaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--ChangeLog8
-rw-r--r--parser.y8
2 files changed, 13 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 2fcb2460..99baf5ee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
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")); }