From dc35aae3bfb0f5502d0848d9ad6478480a9ddd37 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 13 Aug 2014 19:30:37 -0700 Subject: Uprooting stupidities in handling of output variables. * parser.y (o_elems_transform): Remove useless function which was only unwrapping the strange parse of output vars. (o_elems_opt, rep_elem, quasilit, wordsqlit): Eliminate o_elems_transform call. (o_var, q_var): Eliminate the phrase structure rules which match an extra o_elem or quasi_item, and which incorporate them into the var syntax tree element. Place the modifiers into the third position, not fourth. * eval.c (subst_vars): Eliminate handling of "pat" element. Actually that was not even there thanks to o_elems_transform being applied: dead code. Pull modifiers from the third element of the var form now, not fourth. * match.c (subst_vars): Similar changes as in the match.c subst_vars function. Here the pat variable is even more obviously useless; if it is not nil, it is just punted back to the spec. --- match.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'match.c') diff --git a/match.c b/match.c index 67d917ea..38e23b2c 100644 --- a/match.c +++ b/match.c @@ -1392,8 +1392,7 @@ static val subst_vars(val spec, val bindings, val filter) if (sym == var_s) { val expr = second(elem); - val pat = third(elem); - val modifiers = fourth(elem); + val modifiers = third(elem); val str = txeval(spec, expr, bindings); /* If the object is a list, we let format_field deal with the @@ -1402,9 +1401,6 @@ static val subst_vars(val spec, val bindings, val filter) if (!stringp(str) && !listp(str)) str = tostringp(str); - if (pat) - spec = cons(pat, rest(spec)); - if (modifiers) { spec = cons(format_field(str, modifiers, filter, curry_123_2(func_n3(txeval), spec, bindings)), -- cgit v1.2.3