summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--match.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/match.c b/match.c
index 6414b0ef..37c11922 100644
--- a/match.c
+++ b/match.c
@@ -3073,7 +3073,7 @@ val match_expand_keyword_args(val args)
if (more &&
(sym == maxgap_k || sym == mingap_k || sym == gap_k ||
sym == times_k || sym == mintimes_k || sym == maxtimes_k ||
- sym == lines_k || sym == counter_k || sym == vars_k ||
+ sym == lines_k || sym == vars_k ||
sym == list_k || sym == string_k))
{
val form = car(next);
@@ -3084,6 +3084,15 @@ val match_expand_keyword_args(val args)
ptail = list_collect(ptail, form_ex);
args = cdr(next);
} else if (more &&
+ (sym == counter_k)) {
+ val form = car(next);
+ val vars_like_wrap = cons(form, nil);
+ val vars_like_ex = match_expand_vars(vars_like_wrap);
+
+ ptail = list_collect(ptail, sym);
+ ptail = list_collect(ptail, car(vars_like_ex));
+ args = cdr(next);
+ } else if (more &&
(sym == tlist_k)) {
ptail = list_collect(ptail, sym);
ptail = list_collect(ptail, expand_meta(car(next), nil));