From f4490cde15518f1cc491ab31a13d25d37cb080c4 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 29 Aug 2016 05:59:12 -0700 Subject: Fix broken expansion in @(if) and output @(repeat). * parser.y (if_clause, elif_clauses_opt, repeat_clause, rep_elem): Recognize argument expressions as n_exprs_opt rather than exprs_opt, so that expand_meta is not applied. They are Lisp expressions, which are broken by expand_meta. A failing test case is op syntax with @num metanum variables, e.g. @(if (foo (op bar @1.slot))). --- parser.y | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'parser.y') diff --git a/parser.y b/parser.y index 181980ba..92b489d4 100644 --- a/parser.y +++ b/parser.y @@ -362,7 +362,7 @@ additional_parts : END newl { $$ = nil; } yyerr("empty or subclause"); } ; -if_clause : IF exprs_opt ')' +if_clause : IF n_exprs_opt ')' newl clauses_opt elif_clauses_opt else_clause_opt @@ -384,11 +384,11 @@ if_clause : IF exprs_opt ')' $$ = cons(if_s, nappend2(branch, nappend2(elifs, els))); rl($$, num($1)); } } - | IF exprs_opt ')' + | IF n_exprs_opt ')' newl error { $$ = nil; yybadtok(yychar, lit("if clause")); } ; -elif_clauses_opt : ELIF exprs_opt ')' newl +elif_clauses_opt : ELIF n_exprs_opt ')' newl clauses_opt elif_clauses_opt { if (opt_compat && opt_compat <= 136) { val req = rlcp(cons(require_s, $2), $2); @@ -631,7 +631,7 @@ out_clause : repeat_clause { $$ = cons($1, nil); } | o_line { $$ = $1; } ; -repeat_clause : REPEAT exprs_opt ')' newl +repeat_clause : REPEAT n_exprs_opt ')' newl out_clauses_opt repeat_parts_opt END newl { $$ = repeat_rep_helper(repeat_s, @@ -706,7 +706,7 @@ o_elem : TEXT { $$ = string_own($1); | rep_elem { $$ = $1; } ; -rep_elem : REP exprs_opt ')' o_elems_opt +rep_elem : REP n_exprs_opt ')' o_elems_opt rep_parts_opt END { $$ = repeat_rep_helper(rep_s, $2, $4, $5); rl($$, num($1)); } | REP error { $$ = nil; -- cgit v1.2.3