summaryrefslogtreecommitdiffstats
path: root/parser.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-09-23 15:04:31 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-09-23 15:04:31 -0700
commit77b5a3eda0eda28b30addcfcd62cce1bae8542cf (patch)
treeb7aa4a492896547909f042580171c1e503591ce5 /parser.c
parent158f99b41bc0b75b6f571fc4f87f020ef80268ca (diff)
downloadtxr-77b5a3eda0eda28b30addcfcd62cce1bae8542cf.tar.gz
txr-77b5a3eda0eda28b30addcfcd62cce1bae8542cf.tar.bz2
txr-77b5a3eda0eda28b30addcfcd62cce1bae8542cf.zip
awk macro: support regexes better in ranges.
* share/txr/stdlib/awk.tl (sys:awk-compile-time): New slot, rng-rec-temp. Specifies the name of a temporary variable which is scoped over the evaluation of ranges, and which caches a reference to the current record string. (sys:range-test): New function. (awk:let): Rename the original rng macrolet to sys:rng, and introduce rng as a wrapper around it which inserts the logic for calling the regex or function that might emerge from the evaluation of from-expr or to-expr. (awk): If ranges are present in the syntax, then bind the temporary variable which caches the record around the evaluations of the ranges. * txr.1: Document new special behavior of rng w.r.t functions and regexes. Add admonition against modifying rec and some other awk variables from range expressions.
Diffstat (limited to 'parser.c')
0 files changed, 0 insertions, 0 deletions