summaryrefslogtreecommitdiffstats
path: root/parser.y
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-02-16 00:48:01 -0800
committerKaz Kylheku <kaz@kylheku.com>2014-02-16 00:48:01 -0800
commitced323fff8f93bffe0666eba6e498b113aa3bd0a (patch)
treee4402c0f9031456c2234bced84a21e308744da6e /parser.y
parentc3df6f9980a39f1302b028fa6369ace09db374a2 (diff)
downloadtxr-ced323fff8f93bffe0666eba6e498b113aa3bd0a.tar.gz
txr-ced323fff8f93bffe0666eba6e498b113aa3bd0a.tar.bz2
txr-ced323fff8f93bffe0666eba6e498b113aa3bd0a.zip
Bugfixes: not propagating source loc info in quasiliterals.
* eval.c (expand_quasi): Add some rlcp's here. * parser.y (o_var, quasi_items, o_elems_transform): Likewise.
Diffstat (limited to 'parser.y')
-rw-r--r--parser.y24
1 files changed, 16 insertions, 8 deletions
diff --git a/parser.y b/parser.y
index 5124ad31..797d3711 100644
--- a/parser.y
+++ b/parser.y
@@ -668,13 +668,17 @@ modifiers : NUMBER { $$ = cons($1, nil); }
| list { $$ = cons($1, nil); }
;
-o_var : SYMTOK { $$ = list(var_s, sym_helper($1, nil), nao); }
+o_var : SYMTOK { $$ = list(var_s, sym_helper($1, nil), nao);
+ rl($$, num(lineno)); }
| SYMTOK o_elem { $$ = list(var_s, sym_helper($1, nil),
- $2, nao); }
+ $2, nao);
+ rl($$, num(lineno)); }
| '{' expr exprs_opt '}'
- { $$ = list(var_s, $2, nil, $3, nao); }
+ { $$ = list(var_s, $2, nil, $3, nao);
+ rl($$, num(lineno)); }
| '{' expr exprs_opt '}' o_elem
- { $$ = list(var_s, $2, $5, $3, nao); }
+ { $$ = list(var_s, $2, $5, $3, nao);
+ rl($$, num(lineno)); }
| SYMTOK error { $$ = nil;
yybadtoken(yychar, lit("variable spec")); }
;
@@ -888,8 +892,10 @@ quasilit : '`' '`' { $$ = null_string; }
yybadtoken(yychar, lit("string literal")); }
;
-quasi_items : quasi_item { $$ = cons($1, nil); }
- | quasi_item quasi_items { $$ = cons($1, $2); }
+quasi_items : quasi_item { $$ = cons($1, nil);
+ rl($$, num(lineno)); }
+ | quasi_item quasi_items { $$ = cons($1, $2);
+ rl($$, num(lineno)); }
;
quasi_item : litchars { $$ = lit_char_helper($1); }
@@ -1012,7 +1018,9 @@ static val o_elems_transform(val o_elems)
val pat = third(elem);
val modifiers = fourth(elem);
- ptail = list_collect(ptail, list(first(elem), sym, nil, modifiers, nao));
+ ptail = list_collect(ptail,
+ rlcp(list(first(elem), sym, nil, modifiers, nao),
+ elem));
elem = pat;
}
@@ -1020,7 +1028,7 @@ static val o_elems_transform(val o_elems)
ptail = list_collect(ptail, elem);
}
- return o_elems_out;
+ return rlcp(o_elems_out, o_elems);
}
static val define_transform(val define_form)