diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-12-26 20:14:13 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-12-26 20:14:13 -0800 |
commit | 837b0f15d86b21665fdf7c5d55cbe4ecd6d42ea4 (patch) | |
tree | 51014445b28a04de955cbdc8bd251538e464f8c0 /match.h | |
parent | 5335d788dc601a50fc26319d39b21bdcaf1457b6 (diff) | |
download | txr-837b0f15d86b21665fdf7c5d55cbe4ecd6d42ea4.tar.gz txr-837b0f15d86b21665fdf7c5d55cbe4ecd6d42ea4.tar.bz2 txr-837b0f15d86b21665fdf7c5d55cbe4ecd6d42ea4.zip |
TXR quasiliterals and output vars treated as Lisp.
* eval.c (format_field): Function moved here from match.c,
along with the introduction of a new behavior: if a meta-expr
occurs among the modifiers, its constituent expression
is evaluated in its place. This allows for @{a @[expr]}
which was previously not allowed in Lisp quasiliterals,
but worked in TXR quasiliterals due to the treatment
of @ by txeval.
(subst_vars): Static function turns external, so code in
match.c can call it instead of the subst_vars in that module.
For that purpose, it needs to take a filter argument and
process filters, like the match.c subst_vars.
(op_quasi_lit): Pass nil as filter argument to subst_vars.
* eval.h (format_field, subst_vars): Declared.
* match.c (format_field): Function removed, moved to
eval.c and slightly changed.
(subst_vars): Renamed to tx_subst_vars. By default, now just a
wrapper for subst_vars. In compatibility mode, invokes the
old logic.
(do_txeval, do_output_line): Call tx_subst_vars rather than
subst_vars.
* match.h (format_field): Declaration removed.
* parser.y (expr): Grammar production removed: no longer
referenced.
(o_var): Braced variable case now parsed as n_expr, and
expanded as expr by default, since this is Lisp now. In
compatibility mode, expanded using expand_meta.
Also SYMTOK case must be subject to expansion; an output
var can now be a symbol macro.
(expand_meta): Expand a quasi-literal as Lisp, except
in compatibility mode.
* txr.1: Bit of a documentation update. Existing doc isn't
totally clear.
Diffstat (limited to 'match.h')
-rw-r--r-- | match.h | 1 |
1 files changed, 0 insertions, 1 deletions
@@ -27,7 +27,6 @@ extern val text_s, choose_s, gather_s, do_s, require_s; extern val close_s, load_s, include_s, mod_s, modlast_s, line_s; extern val counter_k, env_k, var_k; -val format_field(val string_or_list, val modifier, val filter, val eval_fun); val match_filter(val name, val arg, val other_args); val match_fun(val name, val args, val input, val files); val include(val specline); |