[true, "foo", true] should match [*, true]
nmichel opened this issue · comments
Nicolas commented
Both following calls should yield {true, []}
ejpet:match("[false, 42, true]", "[*, true]") => {true, []}
ejpet:match("[true, 42, true]", "[*, true]") => {false, []}
There is something wrong when the last matching expression ("true") is matched by an element before the last one.
Nicolas commented
After deeper investigations, it appears that matching of lists is done wrong and must fully rebuilt.
As an example, list [42, 1, 42, 42, 12]
should match expression [*, 42, 42, 12, *]
, but it don't.
Parser of list matching expressions produces invalid syntax sub-trees, generators can't use to produce the appropriate matching functions.