summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-09-17 14:31:58 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-09-17 14:31:58 -0700
commit848e713f8fd84af478d9d2c31661b50081ee136b (patch)
treec91a6362a4096b4e51e71bd029e524985d545b07 /txr.1
parent6a61ffbabf4a3c5616c5fbf30c7dff7b1af4dd39 (diff)
downloadtxr-848e713f8fd84af478d9d2c31661b50081ee136b.tar.gz
txr-848e713f8fd84af478d9d2c31661b50081ee136b.tar.bz2
txr-848e713f8fd84af478d9d2c31661b50081ee136b.zip
New awk variable: krs.
* share/txr/stdlib/awk.tl (sys:awk-state): New slot, krs. (sys:awk-state loop): Use record-adapter if krs is true, even if the default fs is in effect. Pass value of krs to record-adapter function. (sys:awk-let): Provide krs "awk variable" symbol macro. * txr.1: Documented krs. Clarified semantics of rs being those of both separation and termination.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.128
1 files changed, 24 insertions, 4 deletions
diff --git a/txr.1 b/txr.1
index 7e5ce1e7..f73c370c 100644
--- a/txr.1
+++ b/txr.1
@@ -37733,11 +37733,15 @@ instantiated by the
.code record-adapter
function.
-The meaning of
+The regular expression pattern stored in
+.code rs
+is used to matches substrings in the input which separate or terminate records.
+Unless the
+.code krs
+variable is set true, the substrings which match
.code rs
-is that it matches substrings in the input which separate records. Records
-consist of the non-matching extents between matches for
-.codn rs .
+are discarded and the records consist of the non-matching extents between
+them.
The initial value of
.code rs
@@ -37745,6 +37749,22 @@ is
.strn "\en" :
the newline character. This means that, by default, records are lines.
+If a match for the record separator occurs at the end of the stream,
+it is not considered to delimit an empty record, but acts as the
+terminator for the previous record.
+
+.coNP Variable @ krs
+.desc
+The awk variable
+.code krs
+stands for "keep record separator". It is a Boolean variable, initialized to
+.codn nil .
+
+If it is set to a true value, then the separating text matched
+by the pattern in the
+.code rs
+variable is retained as part of the preceding record rather than removed.
+
.coNP Variable @ fs
.desc
The awk variable