diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-10-25 18:39:58 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-10-25 18:39:58 -0700 |
commit | af623d27b590f3596b219c9be2faa1853f8d9db4 (patch) | |
tree | b81451c9d82aaaef211b605571127ce1e9e2bac1 /configure | |
parent | 8357dd0ce75b5cace504acfcef2c31ee83a35e9c (diff) | |
download | txr-af623d27b590f3596b219c9be2faa1853f8d9db4.tar.gz txr-af623d27b590f3596b219c9be2faa1853f8d9db4.tar.bz2 txr-af623d27b590f3596b219c9be2faa1853f8d9db4.zip |
cat-str/join/join-with: allow nested sequences
The measure/allocate/catenate functions which underlie
the cat-str implementation are streamlined, simplifying
the code. At the same time, they handle nested sequences
of string/character items.
* lib.c (struct cat_str): New member, seen_one. This flips
from 0 to 1 after the first item has been seen in the
cat_str_measure pass or cat_str_append pass. Each item
other than the first is preceded by a separator.
(cat_str_measure, cat_str_append): The more_p argument
is dropped. We account for the separator with the help
of the new seen_one flag, which allows us to easily
recurse over items that are sequences.
(cat_str_alloc): Reset the seen_one flag in preparation
for the cat_str_append pass.
(cat_str, vscat, scat2, scat3, join_with): Simplified.
* tests/015/split.tl: New tests.
* txr.1: Redocumented.
Diffstat (limited to 'configure')
0 files changed, 0 insertions, 0 deletions