summaryrefslogtreecommitdiffstats
path: root/ftw.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-09-07 07:14:02 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-09-07 07:14:02 -0700
commit98ed59198be3104e82c00734e01f4a1022440d1b (patch)
tree1d6130cc914977b7897834407f6148cfc54cbec0 /ftw.c
parent575851b07a498847b8ddeaf94db8bc177c4f57c1 (diff)
downloadtxr-98ed59198be3104e82c00734e01f4a1022440d1b.tar.gz
txr-98ed59198be3104e82c00734e01f4a1022440d1b.tar.bz2
txr-98ed59198be3104e82c00734e01f4a1022440d1b.zip
string-extend: third optional argument.
A Boolean optional argument to string-extend indicates whether this is likely the last call to string-extend, so memory can be trimmed accordingly. * eval.c (eval_init): Update string-extend registration. * filter.c (trie_filter_string): Pass nil for new argument of string_extend. * lib.c (str_seq, replace_str, lazy_str_force, lazy_str_force_upto): Pass nil for new argument of string_extend. (rem_impl, remove_if, separate): Pass t for new argument of string_extend on last iteration, nil otherwise. (string_extend): Implement new third argument, defaulted to nil. Switch from chk_grow_vec to the more specific chk_wrealloc, which simplifies the code. * lib.h (string_extend): Declaration updated. * parser.y (litchars): Pass t as last argument of string_extend since we know syntactically that these reductions finalize the string. (restlitchar): Pass nil as the last argument of string_extend, since we know syntactically that it isn't the last. * regex.c (scan_until_common): Pass nil for new argument of string_extend. * txr.1: Documented.
Diffstat (limited to 'ftw.c')
0 files changed, 0 insertions, 0 deletions