From 3a39417c79287b8231e70c4a2742fd8ebe3331ef Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 26 Mar 2012 20:28:53 -0700 Subject: Filtering on lists and nested lists is hereby made to work. For instance given @(bind a ("a" "b" "c")) it is now possible to do @(filter :upcase a) whereby a promptly takes on the value ("A" "B" "C"). * filter.c (string_filter): Function renamed to string_tree_filter. (compound_filter): Follows rename. (filter_string): Function renamed to filter string tree. Can filter tree of strings, or possibly other objects, if the filter function allows. (filter_equal): No special case test for objects that are strings. Just put them through the filter. * filter.h (filter_string): Declaration updated. * match.c (format_field, subst_vars, v_filter): Follow rename. --- match.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'match.c') diff --git a/match.c b/match.c index b70a796e..e2128111 100644 --- a/match.c +++ b/match.c @@ -1291,7 +1291,7 @@ val format_field(val obj, val modifier, val filter, val eval_fun) } if (filter) - str = filter_string(filter, str); + str = filter_string_tree(filter, str); } { @@ -1347,7 +1347,7 @@ static val subst_vars(val spec, val bindings, val filter) else str = if3(stringp(str), str, tostringp(str)); - spec = cons(filter_string(filter, str), rest(spec)); + spec = cons(filter_string_tree(filter, str), rest(spec)); } continue; @@ -3312,7 +3312,7 @@ static val v_filter(match_files_ctx *c) if (!existing) sem_error(specline, lit("filter: variable ~a is unbound"), var, nao); - *cdr_l(existing) = filter_string(filter, cdr(existing)); + *cdr_l(existing) = filter_string_tree(filter, cdr(existing)); } uw_env_end; -- cgit v1.2.3