From 0294e98b13a70e91391952e7e24a47407e6d0508 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 26 Feb 2014 06:57:47 -0800 Subject: * 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. --- parser.y | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'parser.y') 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")); } -- cgit v1.2.3