summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2011-09-22 13:23:02 -0700
committerKaz Kylheku <kaz@kylheku.com>2011-09-22 13:23:02 -0700
commit24d450b011d80df3d57bbf47731d1fbfa15043dd (patch)
treec3cf36c1cf5d28a71027e212744de2a535875f5b /txr.1
parentd15d57f1e2edfb5cd556fcf8f32b6c3dcfadcfff (diff)
downloadtxr-24d450b011d80df3d57bbf47731d1fbfa15043dd.tar.gz
txr-24d450b011d80df3d57bbf47731d1fbfa15043dd.tar.bz2
txr-24d450b011d80df3d57bbf47731d1fbfa15043dd.zip
Useful second argument in skip directive for skipping
a minimum number of lines. * match.c (match_files): New behavior in skip_s case. * txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.122
1 files changed, 22 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 5dcc077f..382e3840 100644
--- a/txr.1
+++ b/txr.1
@@ -1102,6 +1102,28 @@ be written instead:
end @BEG_SYMBOL
@(end)
+If the symbol nil is used in place of a number, it means to scan
+an unlimited range of lines; thus, @(skip nil) is equivalent to @(skip).
+
+There may be a second numeric argument. This specifies a minimum
+number of lines to skip before looking for a match. For instance,
+skip 15 lines and then search indefinitely for "begin ...":
+
+ @(skip nil 15)
+ begin @BEG_SYMBOL
+
+The two arguments may be used together. For instance, the following
+matches if, and only if, the 15th line of input starts with "begin ":
+
+ @(skip 1 15)
+ begin @BEG_SYMBOL
+
+Essentially, @(skip 1 <n>) means "hard skip by <n>" lines, then
+match the query without scanning. @(skip 1 0) is the same as @(skip 1), which
+is a noop, because it means: "the remainder of the query must match starting on
+the very next line", or, more briefly, "skip exactly zero lines", which is the
+behavior if the skip directive is omitted altogether.
+
.SS The Trailer Directive
The trailer directive introduces a trailing portion of a query or subquery