diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-09-17 14:31:58 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-09-17 14:31:58 -0700 |
commit | 848e713f8fd84af478d9d2c31661b50081ee136b (patch) | |
tree | c91a6362a4096b4e51e71bd029e524985d545b07 /txr.1 | |
parent | 6a61ffbabf4a3c5616c5fbf30c7dff7b1af4dd39 (diff) | |
download | txr-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.1 | 28 |
1 files changed, 24 insertions, 4 deletions
@@ -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 |