Given this grammar:
module test
{
language test
{
syntax Main = OneTwo*;
syntax OneTwo
= o:One t:Two "\r\n"
=> Result { One => true, Two => true }
| Two One "\r\n"
=> Result { One => true, Two => true }
| One "\r\n"
=> Result { One => true, Two => false }
| Two "\r\n"
=> Result { One => false, Two => true };
token One = "one";
token Two = "two";
interleave Ignore = " ";
}
}
How could I refactor the syntax “OneTwo” to have only a single projection?