fimpp
fimpp copied to clipboard
Fix ambiguity in conjunctions and tuple literals.
This change removes the possibility of using tuple literals in the beginning of a conjuction conditional. This fixes issue #8.
For example, consider this valid conditional:
Applejack has more than one and Pinkie Pie has more than one
Without this change, one and Pinkie Pie will be parsed as a tuple literal, which then causes the parser to fail on the has keyword. The syntax itself doesn't seem ambiguous in this particular case. However, the parser only fails at the andCondition, so it won't try to reparse one as a simpleExpression instead of a listExpression.
It might be possible to fix the parser to correctly parse this while retaining the possibility of having tuple literals. Removing literals seems simpler though.