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 | 2b08915302b3d6a2487cb8d072fd672e95e7c703 (patch) | |
tree | f0f3b487ea4e41dc67e01ccce735ee17e9a322c6 /lib.h | |
parent | 234d7f89eeb11e0774357407b738f1cdaaa154ff (diff) | |
download | txr-2b08915302b3d6a2487cb8d072fd672e95e7c703.tar.gz txr-2b08915302b3d6a2487cb8d072fd672e95e7c703.tar.bz2 txr-2b08915302b3d6a2487cb8d072fd672e95e7c703.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 'lib.h')
-rw-r--r-- | lib.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -679,7 +679,7 @@ extern val zeroplus_s, optional_s, compl_s, compound_s; extern val or_s, and_s, quasi_s, quasilist_s; extern val skip_s, trailer_s, block_s, next_s, freeform_s, fail_s, accept_s; extern val all_s, some_s, none_s, maybe_s, cases_s, collect_s, until_s, coll_s; -extern val define_s, output_s, single_s, first_s, last_s, empty_s; +extern val define_s, output_s, push_s, single_s, first_s, last_s, empty_s; extern val repeat_s, rep_s, flatten_s, forget_s; extern val local_s, merge_s, bind_s, rebind_s, cat_s; extern val try_s, catch_s, finally_s, throw_s, defex_s, deffilter_s; |