diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-06-27 12:06:26 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-06-27 12:06:26 -0700 |
commit | 4649efb0b4eeb1515bc92711ecb65a2bce23d202 (patch) | |
tree | f8db794a859d6929b087e51977e2c05a5d1ddab3 /tests/015 | |
parent | 9dc109581a299973777ea5082f646d7ac7d82f7c (diff) | |
download | txr-4649efb0b4eeb1515bc92711ecb65a2bce23d202.tar.gz txr-4649efb0b4eeb1515bc92711ecb65a2bce23d202.tar.bz2 txr-4649efb0b4eeb1515bc92711ecb65a2bce23d202.zip |
regex-from-trie: bugs processing compressed trie.
* filter.c (regex_from_trie): If a hash key maps to a string,
do not treat that as a trie; it is the value for that node.
A value is only a trie if it is a cons or hash. Also, in this
case do not make a compound regex.
* tests/015/trie.tl: Add duplicate of regex test case using
regex from compressed tree.
Diffstat (limited to 'tests/015')
-rw-r--r-- | tests/015/trie.tl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/015/trie.tl b/tests/015/trie.tl index 48e7e050..de88a797 100644 --- a/tests/015/trie.tl +++ b/tests/015/trie.tl @@ -33,6 +33,7 @@ (trie-compress tr1) (defvarl rx0 (regex-compile (regex-from-trie tr0))) +(defvarl rx1 (regex-compile (regex-from-trie tr1))) (mvtest (build (each ((d dat)) (add (filter-string-tree tr0 d)))) enu @@ -47,3 +48,7 @@ (mvtest (build (each ((d dat)) (add [rx0 d]))) dat (build (each ((n ndt)) (add [rx0 n]))) (repeat '(nil) (len dat))) + +(mvtest + (build (each ((d dat)) (add [rx1 d]))) dat + (build (each ((n ndt)) (add [rx1 n]))) (repeat '(nil) (len dat))) |