Support Immutable.List in patterns

This commit is contained in:
Tony Garnock-Jones 2016-02-06 07:41:31 -05:00
parent 4cdd595301
commit f12f24b133
1 changed files with 8 additions and 0 deletions

View File

@ -103,6 +103,14 @@ function compilePattern(v, p) {
return rseq(SOA, acc);
}
if (Immutable.List.isList(p)) {
acc = rseq(EOA, acc);
p.reverse().forEach(function (element) {
acc = walk(element, acc);
});
return rseq(SOA, acc);
}
if (p instanceof $Embedded) {
return appendTrie(p.trie, function (v) { return acc; });
} else {