diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-03-04 19:51:09 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-03-04 19:51:09 -0800 |
commit | 85190e9519fcd930728571af637324edcf478762 (patch) | |
tree | 79964099f114db193be24d75399054bb90bb275d | |
parent | e0ec061c71fcec495c97a336663498a218f470d7 (diff) | |
download | txr-85190e9519fcd930728571af637324edcf478762.tar.gz txr-85190e9519fcd930728571af637324edcf478762.tar.bz2 txr-85190e9519fcd930728571af637324edcf478762.zip |
bugfix: :counter var not registered tentative.
This test case suffers a spurious unbound variable warning:
@(collect :counter x)
@(bind y @x)
@(end)
* match.c (match_expand_keyword_args): Register the :counter
variable as a tentative definition with match_reg_var.
We don't do this for :vars because they are not newly
introduced: the :vars construct doesn't bind. The :counter
feature is the only keyword feature in collect which binds
a new variable.
-rw-r--r-- | match.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -3092,6 +3092,10 @@ val match_expand_keyword_args(val args) ptail = list_collect(ptail, sym); ptail = list_collect(ptail, car(vars_like_ex)); args = cdr(next); + if (consp(form)) + match_reg_var(car(form)); + else + match_reg_var(form); } else if (more && (sym == tlist_k)) { ptail = list_collect(ptail, sym); |