diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-06-12 21:17:20 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-06-12 21:17:20 -0700 |
commit | 034799fc0288388d08dcfbcf6230cb698942ba69 (patch) | |
tree | f0f3b487ea4e41dc67e01ccce735ee17e9a322c6 /match.h | |
parent | f2efe6c4cd019bea22717ac73734adb83e9176d5 (diff) | |
download | txr-034799fc0288388d08dcfbcf6230cb698942ba69.tar.gz txr-034799fc0288388d08dcfbcf6230cb698942ba69.tar.bz2 txr-034799fc0288388d08dcfbcf6230cb698942ba69.zip |
New @(push) directive.
@(push) is like @(output), but feeds back into input.
Use carefully.
* parser.y (PUSH): New token.
(output_push): New nonterminal symbol.
(output_clause): Handle OUTPUT or PUSH via output_push.
Some logic moved to output_helper.
(output_helper): New function. Transforms both @(output)
and @(push) directives. Checks both for valid keywords;
push has only :filter.
* parser.l (grammar): Recognize @(push similarly to other
directives.
* lib.[ch] (push_s): New symbol variable.
* match.c (v_output_keys): Internal linkage changes to external.
(v_push): New function.
(v_parallel): We must fix the max_line algorithm not to
use an initial value of zero, because lines can go negative
thanks to @(push). We end up rejecting the pushed data.
(v_collect): We can no longer assert that the data line
number doesn't retreat.
(dir_tables_init): Register push directive in table of
vertical directives.
* match.h (append_k, continue_k, finish_k): Existing symbol
variables declared.
(v_output_keys): Declared.
* y.tab.c.shipped,
* y.tab.h.shipped,
* lex.yy.c.shipped: Updated.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'match.h')
-rw-r--r-- | match.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -30,6 +30,10 @@ extern val text_s, choose_s, gather_s, do_s, mdo_s, require_s, in_package_s; extern val close_s, load_s, include_s, mod_s, modlast_s, line_s; extern val else_s, elif_s; extern val counter_k, vars_k, lists_k, env_k, var_k, into_k, named_k, noclose_k; +extern val append_k, continue_k, finish_k; + +extern val v_output_keys; + val match_expand_keyword_args(val elem); val match_expand_elem(val elem); val match_filter(val name, val arg, val other_args); |