diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2025-01-28 20:25:37 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2025-01-28 20:25:37 -0800 |
commit | bb71dcaa3ce19ec48d8b352566a21cb1f5f26c2f (patch) | |
tree | d5c9c53cac417f0607929a3204fb8375c4f39a3b /signal.c | |
parent | 66f3e6b72dad5a2641bf42fc3c1b32f3c5dfaadd (diff) | |
download | txr-bb71dcaa3ce19ec48d8b352566a21cb1f5f26c2f.tar.gz txr-bb71dcaa3ce19ec48d8b352566a21cb1f5f26c2f.tar.bz2 txr-bb71dcaa3ce19ec48d8b352566a21cb1f5f26c2f.zip |
awk: use prepared lambdas for field separation.
Handle field separations with lambdas, similarly to record
separation. The idea is that we replace the rec-to-f method,
which contains a cond statement checking the variables for
which field separation discipline applies, with a lambda which
is updated whenever any of those ariables change.
* awk.tl (awk-state): New instance slot, rec-to-f.
(awk-state :postinit): Call new upd-rec-to-f method
so that rec-to-f is populated with the default field
separating lambda.
(awk-state rec-to-f): Method removed.
(awk-state upd-rec-to-f): New method, based on rec-to-f.
This doesn't perform the field separation, but returns
a lambda which will perform it.
(awk-state loop): We must call upd-rec-to-f whenever
we change par-mode, because it influences field separation.
(awk-mac-let): Replace the symbol macros fs, ft, fw and
kfs with new implementations that use the reactive slot
mechanism provided by rslot. Whenever the awk macro assigns
any of these, the upd-rec-to-f method will be called.
* tests/015/awk-basic.tl: New file. These basic tests of
field separation pass before and after this change.
* tests/common.tl (otest, motest): New macros.
Diffstat (limited to 'signal.c')
0 files changed, 0 insertions, 0 deletions