summaryrefslogtreecommitdiffstats
path: root/tests/015/trie.tl
Commit message (Collapse)AuthorAgeFilesLines
* regex-from-trie: correctly handle empty trie.Kaz Kylheku2021-06-271-0/+4
| | | | | | | | | | * filter.c (regex_from_trie): An empty trie matches nothing, so we must return the t regex syntax (match nothing), not nil (match empty string). A hash-based trie matches nothing if it is empty; but if it has user data, then it matches the empty string. * tests/015/trie.tl: Test cases added.
* regex-from-trie: bugs processing compressed trie.Kaz Kylheku2021-06-271-0/+5
| | | | | | | | | | * 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.
* regex-from-trie: bugfix: incomplete regex.Kaz Kylheku2021-06-271-1/+1
| | | | | | | | | | * filter.c (regex_from_trie): The code is neglecting to check whether there is a match of the input *at* the given hash table, which is true if it has user data. In that case, the empty regex must be added as a parallel branch. * tests/015/trie.tl: The first regex test case works now. The second one is incorrect and is replaced.
* filter: regex-from-trie produces bad or syntax.Kaz Kylheku2021-06-271-0/+49
This is not a complete fix yet; the test case still fails. * filter.c (regex_from_trie): The (or ...) operator in the regex language is strictly binary. Do not produce a variable-argument or expression. * tests/015/trie.tl: New file.