Redundant `X | X` rules are allowed and mismanaged.
This is a testcase that demonstrates the problem (in tests/basic.rs):
multiple {
A = X:"x" | Y:"x";
}:
A("x") => "\
1:1-1:2 => A::X(
1:1-1:2,
)";
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.
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.