diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-09-08 06:33:30 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-09-08 06:33:30 -0700 |
commit | 97a17b79dd558c8ee8648a0acf2d50299e3c5125 (patch) | |
tree | fdbd405af121a734f0f7ae7a5a144ef14ba63d98 /lisplib.c | |
parent | aef0f9e008b2c949b729ac0a43a5fbb0984efe96 (diff) | |
download | txr-97a17b79dd558c8ee8648a0acf2d50299e3c5125.tar.gz txr-97a17b79dd558c8ee8648a0acf2d50299e3c5125.tar.bz2 txr-97a17b79dd558c8ee8648a0acf2d50299e3c5125.zip |
Range operators for awk macro.
* share/txr/stdlib/awk.tl (sys:awk-state): New slot,
rng-vec: holds boolean flags for ranges.
New slot, rng-n, holds size for rng-vec.
New :postinit handler for creating vector for
rng-vec.
(sys:awk-compile-time): New struct.
(sys:awk-expander): Construct an awk compile time,
and return that as one of the values.
(sys:awk-let): Provide (rng) local macro: the two argument
range operator. Generates code and keeps track of
number of ranges and their association to a position
in rng-vec using the compile-time info structure.
(awk): Capture awk compile-time object from expander.
Initialize rng-n slot of awk state with
number of ranges indicated in compile time info.
Pass compile-time info to awk:let macro.
Binding of lambda and of awk state had to be reordered
because macro-expansion of the lambda fills in the compile
time info which is then used in the expansion of the
constructing expression for the awk state.
Diffstat (limited to 'lisplib.c')
0 files changed, 0 insertions, 0 deletions