From 1b99cd93fac891424942242a596e218dae87d334 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 29 Aug 2016 06:04:25 -0700 Subject: Fix emulation of TXR 135 @(if) semantics. * parser.y (if_clause, elif_clauses_opt): The previous commit changes the emulation of old @(if) behavior, since expressions obtained via the n_exprs_opt grammar phrase are not subject to expand_meta. We can counteract this by calling expand_meta in the compatibility code. --- parser.y | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/parser.y b/parser.y index 92b489d4..655db7ea 100644 --- a/parser.y +++ b/parser.y @@ -367,7 +367,8 @@ if_clause : IF n_exprs_opt ')' elif_clauses_opt else_clause_opt END newl { if (opt_compat && opt_compat <= 136) - { val req = rlcp(cons(require_s, $2), $2); + { val xexp = expand_meta($2, nil); + val req = rlcp(cons(require_s, xexp), $2); val iff = rlcp(cons(cons(cons(req, nil), $5), nil), $2); val elifs = $6; val els = cons($7, nil); @@ -391,7 +392,8 @@ if_clause : IF n_exprs_opt ')' 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); + { val xexp = expand_meta($2, nil); + val req = rlcp(cons(require_s, xexp), $2); $$ = cons(cons(cons(req, nil), $5), $6); } else { val expr = expand(car($2), nil); -- cgit v1.2.3