summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
Diffstat (limited to 'txr.1')
-rw-r--r--txr.133
1 files changed, 24 insertions, 9 deletions
diff --git a/txr.1 b/txr.1
index 0a9ab615..1b360ea8 100644
--- a/txr.1
+++ b/txr.1
@@ -3354,17 +3354,32 @@ repetition.
If the repeat produces no repetitions, then the body of this clause is output.
If this clause is absent or empty, the repeat produces no output.
+.IP @(mod n m)
+The forms n and m are expressions that evaluate to integers. The value of
+m should be nonzero. The clause denoted this way is active if the repetition
+modulo m is equal to n. The first repetition is numbered zero.
+For instance the clause headed by @(mod 0 2) will be used on repetitions
+0, 2, 4, 6, ... and @(mod 1 2) will be used on repetitions 1, 3, 5, 7, ...
+
+.IP @(modlast n m)
+The meaning of n and m is the same as in @(mod n m), but one more condition
+is imposed. This clause is used if the repetition modulo m is
+equal to n, and if it is the last repetition.
+
.PP
The precedence among the clauses which take an iteration is:
-single > first > last > main. That is if two or more of these clauses
-can apply to a repetition, then the leftmost one in this precedence list
-applies. For instance, if there is just a single repetition, then any of these
-special clause types can apply to that repetition, since it is the only
-repetition, as well as the first and last one. In this situation, if
-there is a single clause present, then the repetition is processed
-using that clause. Otherwise, if there is a first clause present, that
-clause is used. Failing that, a last clause applies. Only if none of these
-clauses are present will the repetition be processed using the main clause.
+single > first > mod > modlast > last > main. That is if two or more of these
+clauses can apply to a repetition, then the leftmost one in this precedence
+list applies. For instance, if there is just a single repetition, then any of
+these special clause types can apply to that repetition, since it is the only
+repetition, as well as the first and last one. In this situation, if there is a
+@(single) clause present, then the repetition is processed using that clause.
+Otherwise, if there is a @(first) clause present, that clause is used. Failing
+that, @(mod) is used if there is such a clause and its numeric conditions
+are satisfied. If not then @(modlast) clauses are considered, and if there
+are none, or none of them activate, then @(last) is considered. If none
+of those clauses are present or apply, then the repetition is processed
+using the main clause.
.SS Nested Repeats