summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2012-01-06 15:39:33 -0800
committerKaz Kylheku <kaz@kylheku.com>2012-01-06 15:39:33 -0800
commit8cdbb92688207d0d9f3bcd37279f89a2cbcdf7a3 (patch)
tree96490ccd1ccd4c1c3f71802a59f5a1cdc1790478 /txr.1
parentb6fdf456e413412aaa7cd132b1f340b5b706eddd (diff)
downloadtxr-8cdbb92688207d0d9f3bcd37279f89a2cbcdf7a3.tar.gz
txr-8cdbb92688207d0d9f3bcd37279f89a2cbcdf7a3.tar.bz2
txr-8cdbb92688207d0d9f3bcd37279f89a2cbcdf7a3.zip
* match.c (v_gather): Implemented until/last clause.
* parser.y (gather_parts, additional_gather_parts): New nonterminals. (gather_clause): Syntax refactored for until/last clause. * txr.1: Updated.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.116
1 files changed, 16 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 8ba7afaf..69f1cc5e 100644
--- a/txr.1
+++ b/txr.1
@@ -1829,6 +1829,14 @@ The syntax follows this pattern
Of course the multi-line clauses are optional. The gather directive takes
keyword parameters, see below.
+Similarly to @(collect), @(gather) has an optional until/last clause:
+
+ @(gather)
+ ...
+ @(until)
+ ...
+ @(end)
+
How gather works is that the text is searched for matches for the single line
and multi-line queries. The clauses are applied in the order in which they appear.
Whenever one of the clauses matches, any bindings it produces are retained and
@@ -1849,6 +1857,14 @@ order:
SHELL=@SHELL
@(end)
+If the until or last clause is present and a match occurs, then the matches
+from the other clauses are discarded and the gather terminates. The difference
+between until and last is that any bindings bindings established in last are
+retained, and the input position is advanced past the matched material.
+The until/last clause has visibility to bindings established in the
+previous clauses in that same iteration, even though those bindings
+end up thrown away.
+
.SS Gather Keyword Parameters
The gather diretive accepts the keyword parameter :vars. The argument to vars is a list