nmichel / ejpet

Matching JSON nodes in Erlang

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[true, "foo", true] should match [*, true]

nmichel opened this issue · comments

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.

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.

Closed by commit 3885078