diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-02-16 00:48:01 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-02-16 00:48:01 -0800 |
commit | ced323fff8f93bffe0666eba6e498b113aa3bd0a (patch) | |
tree | e4402c0f9031456c2234bced84a21e308744da6e /parser.y | |
parent | c3df6f9980a39f1302b028fa6369ace09db374a2 (diff) | |
download | txr-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.y | 24 |
1 files changed, 16 insertions, 8 deletions
@@ -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) |