diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-09-25 10:40:51 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-09-25 10:40:51 -0700 |
commit | 5abb2cea0beec3d4a93c517ded5e0ae5f0b6a818 (patch) | |
tree | 9fe148cacf3e5252928b098fe33c41af6e9cf614 /regex.c | |
parent | ea8a5447522adb776899e61594916fdcb4b210e6 (diff) | |
download | txr-5abb2cea0beec3d4a93c517ded5e0ae5f0b6a818.tar.gz txr-5abb2cea0beec3d4a93c517ded5e0ae5f0b6a818.tar.bz2 txr-5abb2cea0beec3d4a93c517ded5e0ae5f0b6a818.zip |
awk macro: proper fs semantics in paragraph mode.
* share/txr/stdlib/awk.tl (sys:awk-state): New
slots: par-mode, par-mode-fs, par-mode-prev-fs.
(sys:awk-state rec-to-f): In paragraph mode,
detect that fs has changed since the last call.
In that case, take the user's fs and add to it
a newline match. If it is a regex, take the source,
add the syntax and recompile the regex. If it's
a string, build regex around it and compile.
(sys:awk-state loop): Maintain the par-mode-t
variable in the state structure as the rs
value triggers transitions into or out of
paragraph mode.
* txr.1: Updated documentation for rs.
Diffstat (limited to 'regex.c')
0 files changed, 0 insertions, 0 deletions