diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2012-05-17 20:39:21 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2012-05-17 20:39:21 -0700 |
commit | 338fa0de2bb5c943775278eef608ce21723cde19 (patch) | |
tree | 8ee038310c988cdb43f4d9c7543c351c1fe1d24f /txr.1 | |
parent | f1d3884b7492e8c08f964b893153d6b2b5b44361 (diff) | |
download | txr-338fa0de2bb5c943775278eef608ce21723cde19.tar.gz txr-338fa0de2bb5c943775278eef608ce21723cde19.tar.bz2 txr-338fa0de2bb5c943775278eef608ce21723cde19.zip |
* match.c (v_collect): Implemented semantics for repeat symbol.
(dir_tables_init): Register dispatch for repeat to v_collect
function.
* parser.y (collect_repeat): New nonterminal symbol.
(clause): Removed repeat_clause error case because that now clashes
with the syntax in collect_clause.
(collect_clause): Repeat syntax implemented, with help of
collect_repeat.
(out_clause): Error case for collect_clause removed due to
syntactic clash.
* txr.1: Added mention of @(collect :vars nil) and documented
@(repeat) as the shorthand.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -2111,6 +2111,13 @@ or with an until or last clause: ... lines of subquery: last clause @(end) +The repeat symbol may be specified instead of collect, which changes +the meaning, see below: + + @(repeat) + ... lines of subquery + @(end) + The subquery is matched repeatedly, starting at the current line. If it fails to match, it is tried starting at the subsequent line. If it matches successfully, it is tried at the line following the @@ -2369,6 +2376,18 @@ an empty list. @a @(end) +The following means: do not allow any variables to propagate out of any +iteration of the collect and therefore collect nothing: + + @(collect :vars nil) + ... + @(end) + +Instead of writing @(collect :vars nil), it is possible to write +@(repeat). @(repeat) takes all collect keywords, except for :vars. +There is a repeat directive used in @(output) clauses; that is +a different repeat directive. + .SS The Coll Directive The coll directive is a kind of miniature version of the collect directive. |