Open
Description
Problem
I found a bug in lama parser, that is somehow connected to ambiguous grammar rules for case expression and infix operators.
Example code
infix | at ++ (lhs, rhs) {
lhs ++ rhs
}
infix -> at ++ (lhs, rhs) {
lhs ++ rhs
}
(* Prints "WAT" *)
printf ("%s\n",
case "?" of
"?" -> "W"
| "A" -> "T"
esac.string
);
(* Prints W *)
printf ("%s\n",
case "?" of
"?" -> "W"
| "A" -> "T"
esac
)
Expected behaviour
Both outputs are quite reasonable but they should be the same for both expressions.
Environment
- lamac: v1.0 (Version master, e4b34a3, Sat Mar 21 13:05:14 2020 +0300)
- ostap: v0.4 (dboulytchev/ostap@6565c87)