Miksilo
Miksilo copied to clipboard
BiGrammar to Grammar transformation does not remove ignored produce grammars
Ignored produce grammars only have an effect when printing, not when parsing, so it's nicer to optimize them out of the parser. An example of a grammar that produces this scenario is ~~:
def ~~(right: BiGrammar): BiGrammar = {
(this <~ space) ~ right
}
The space between this and right has no effect for parsing.
Add a small optimization that among other things does:
Optimize(IgnoreRight(x, Produce y)) => Optimize(x)