summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-08-10 12:32:51 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-08-12 15:30:22 -0700
commit91a143fae62ba9b06ff85a940a52aec19a3a3ccb (patch)
tree43cda81a68a0dd666f2478dfb42b08dea88efb84 /tests
parent6b3cb1011e70a9a19fa2ccbfc787fd801f93e350 (diff)
downloadtxr-91a143fae62ba9b06ff85a940a52aec19a3a3ccb.tar.gz
txr-91a143fae62ba9b06ff85a940a52aec19a3a3ccb.tar.bz2
txr-91a143fae62ba9b06ff85a940a52aec19a3a3ccb.zip
@(collect): don't default vars if all required missing.
The @(collect) directive disallows the situation when there are required vars, but some are missing (not bound by the collect body). However, the special case is allowed when none of the required variables are bound; that doesn't trigger the exception. There is a poor specification in this area: the issue is that when there are optional variables, and all variables are missing (optional and required), the optional ones are still bound to their default values. Thus, the situations is half-baked: some of the :vars are bound and some are not. This violates the all-or-nothing principle of :vars. This patch addresses the poor specification: if all variables are missing, then the optional variables are not bound to their defaults. * match.c (h_collect, h_coll): Detect the situation when at least one variable is required, and all optional variables are defaulted. In this case, don't propagate any bindings to the collected lists. * txr.1: Doc updated.
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions