diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-01-22 06:06:26 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-01-22 06:06:26 -0800 |
commit | 2d4678796576de8ac362f009df6d44a6ae392853 (patch) | |
tree | 7589c62581f76757860272139c7424929d3dedf9 | |
parent | 9edd914a456121aac8cc59cbcb9764038bb98bd7 (diff) | |
download | txr-2d4678796576de8ac362f009df6d44a6ae392853.tar.gz txr-2d4678796576de8ac362f009df6d44a6ae392853.tar.bz2 txr-2d4678796576de8ac362f009df6d44a6ae392853.zip |
Improve accuracy of expansion of repeat/rep args.
* parser.y (expand_repeat_rep_args): Correctly handle
situation when :counter or :vars appears as an argument
to another keyword. (A warning might be generated here,
since this situation is wrong.)
-rw-r--r-- | parser.y | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -1290,14 +1290,16 @@ static val expand_repeat_rep_args(val args) } else { ptail = list_collect(ptail, arg); } - } else if (arg == counter_k) { - exp_pair = t; - ptail = list_collect(ptail, arg); - continue; - } else if (arg == vars_k) { - exp_pairs = t; - ptail = list_collect(ptail, arg); - continue; + } else if (!exp_pair && !exp_pairs) { + if (arg == counter_k) { + exp_pair = t; + ptail = list_collect(ptail, arg); + continue; + } else if (arg == vars_k) { + exp_pairs = t; + ptail = list_collect(ptail, arg); + continue; + } } exp_pair = exp_pairs = nil; |