Open eddyb opened 5 years ago
I think a reasonable thing to do might be to use IndexSet
instead of Vec
in Or
and make it an error to have duplicate rules (unless they have identical fields?).
I also think it would be reasonable to prohibit identically matching rules in a single Or
disjunction.
One problem with prohibiting identically matching rules is that it reduces to grammar equality, which is undecidable for basically anything with the complexity of CFG or higher.
This is a testcase that demonstrates the problem (in
tests/basic.rs
):The output is the current one and is incorrect: both sides are
"x"
and should match or the situation should be statically denied. But only the first one is observed.