summaryrefslogtreecommitdiffstats
path: root/parser.y
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-03-04 19:32:50 -0800
committerKaz Kylheku <kaz@kylheku.com>2017-03-04 19:32:50 -0800
commit333921ae04dc686b40a875d6d6633af9992d1626 (patch)
tree465ed22d37c85fa6d7bd30eb279456ec7df1fa4f /parser.y
parentd7fd7a190b885a85f170cdc55a3c6ad116a6c870 (diff)
downloadtxr-333921ae04dc686b40a875d6d6633af9992d1626.tar.gz
txr-333921ae04dc686b40a875d6d6633af9992d1626.tar.bz2
txr-333921ae04dc686b40a875d6d6633af9992d1626.zip
Harmonize code with previous commit.
* parser.y (expand_repeat_rep_args): Use a sym local variable to avoid evaluating first(arg) twice, like the previous commit does in another case of this function.
Diffstat (limited to 'parser.y')
-rw-r--r--parser.y5
1 files changed, 3 insertions, 2 deletions
diff --git a/parser.y b/parser.y
index bf87772e..837da618 100644
--- a/parser.y
+++ b/parser.y
@@ -1301,10 +1301,11 @@ static val expand_repeat_rep_args(val args)
}
ptail = list_collect(ptail, iout);
} else if (exp_pair) {
- ptail = list_collect(ptail, list(first(arg),
+ val sym = first(arg);
+ ptail = list_collect(ptail, list(sym,
expand(second(arg), nil),
nao));
- match_reg_var(first(arg));
+ match_reg_var(sym);
} else {
ptail = list_collect(ptail, arg);
}