fimpp
fimpp copied to clipboard
"and" in conditional expressions confused with tuple syntax.
Conjuctions don't work well because the parser confuses the word and with the syntax for tuples.
For instance, this works with or:
Applejack has more than one or Pinkie Pie has more than one
[1.60] parsed: Alternative(
List(
Relational(
VariableValue(applejack),>,NumberValue(1)
),
Relational(
VariableValue(pinkie pie),>,NumberValue(1)
)
)
)
However, replacing or with and:
Applejack has more than one and Pinkie Pie has more than one
[1.47] failure: ‘Has’ ain't no pony I've heard of. Do they have tea parties with ‘Has’?
The source of the problem is that the parser attempts to make a tuple from one and Pinkie Pie has ..., which in turn attempts to make an identifier from Pinkie Pie has .... This then fails here because has is a keyword.
~~I think ^? combinator is not the right approach here. The check for keywords should make the parser backtrack instead of failing.~~