diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2011-10-25 11:22:34 -0400 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2011-10-25 11:22:34 -0400 |
commit | 763f15ad2b8327a04b0dad97982bf19150aa7397 (patch) | |
tree | c971044086d31187cb3151a406b08b8805f69327 | |
parent | 611940affae3262bfdb840b3b087ef61741e8946 (diff) | |
download | txr-763f15ad2b8327a04b0dad97982bf19150aa7397.tar.gz txr-763f15ad2b8327a04b0dad97982bf19150aa7397.tar.bz2 txr-763f15ad2b8327a04b0dad97982bf19150aa7397.zip |
* filter.c (fun_k): New keyword variable.
(function_filter): Use :fun keyword symbol instead of fun.
(filter_init): New keyword variable initialized.
* filter.h (upcase_k, downcase_k, fun_k): Declared.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | filter.c | 11 | ||||
-rw-r--r-- | filter.h | 1 |
3 files changed, 15 insertions, 5 deletions
@@ -1,5 +1,13 @@ 2011-10-25 Kaz Kylheku <kaz@kylheku.com> + * filter.c (fun_k): New keyword variable. + (function_filter): Use :fun keyword symbol instead of fun. + (filter_init): New keyword variable initialized. + + * filter.h (upcase_k, downcase_k, fun_k): Declared. + +2011-10-25 Kaz Kylheku <kaz@kylheku.com> + * match.c (v_bind): Use sem_error to throw errors with line number info. @@ -36,6 +36,10 @@ #include "filter.h" #include "gc.h" +val filters; +val filter_k, lfilt_k, rfilt_k, to_html_k, from_html_k; +val upcase_k, downcase_k, fun_k; + static val make_trie(void) { return make_hash(nil, nil); @@ -142,7 +146,7 @@ static val function_filter(val functions, val string) val get_filter(val spec) { if (consp(spec)) { - if (car(spec) == fun_s) { + if (car(spec) == fun_k) { return curry_12_2(func_n2(function_filter), rest(spec)); } else { val filter_list = mapcar(func_n1(get_filter), spec); @@ -575,10 +579,6 @@ static val html_numeric_handler(val ch) return func_f1(cons(ch, nil), html_dec_continue); } -val filters; -val filter_k, lfilt_k, rfilt_k, to_html_k, from_html_k; -val upcase_k, downcase_k; - void filter_init(void) { protect(&filters, (val *) 0); @@ -591,6 +591,7 @@ void filter_init(void) from_html_k = intern(lit("from_html"), keyword_package); upcase_k = intern(lit("upcase"), keyword_package); downcase_k = intern(lit("downcase"), keyword_package); + fun_k = intern(lit("fun"), keyword_package); sethash(filters, to_html_k, build_filter(to_html_table, t)); { val trie = build_filter(from_html_table, nil); @@ -26,6 +26,7 @@ extern val filters; extern val filter_k, lfilt_k, rfilt_k, to_html_k, from_html_k; +extern val upcase_k, downcase_k, fun_k; val trie_lookup_begin(val trie); val trie_value_at(val node); |