summaryrefslogtreecommitdiffstats
path: root/match.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-12-26 21:16:35 -0800
committerKaz Kylheku <kaz@kylheku.com>2015-12-26 21:16:35 -0800
commit1a591b04b32d9bca406a338c1377aa4526492eaf (patch)
tree6d88912d232ebcc1f10037324ff34dab71ca2902 /match.c
parent837b0f15d86b21665fdf7c5d55cbe4ecd6d42ea4 (diff)
downloadtxr-1a591b04b32d9bca406a338c1377aa4526492eaf.tar.gz
txr-1a591b04b32d9bca406a338c1377aa4526492eaf.tar.bz2
txr-1a591b04b32d9bca406a338c1377aa4526492eaf.zip
Allow @(repeat) and @(rep) to see Lisp globals.
* match.c (extract_bindings): Process the final list of vars. For any variable not already on the list of output bindings, check if it has a Lisp binding, and if so, add *that* binding to the output bindings.
Diffstat (limited to 'match.c')
-rw-r--r--match.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/match.c b/match.c
index 68f228ec..2995aca6 100644
--- a/match.c
+++ b/match.c
@@ -1675,6 +1675,17 @@ static val extract_bindings(val bindings, val output_spec, val vars)
ptail = list_collect(ptail, binding);
}
+ for (; var_list; var_list = cdr(var_list)) {
+ val sym = car(var_list);
+ if (assoc(sym, bindings_out)) {
+ continue;
+ } else {
+ val binding = lookup_var(nil, sym);
+ if (binding)
+ ptail = list_collect(ptail, binding);
+ }
+ }
+
return bindings_out;
}