By declaring precedence for 'else', we suppress conflict warnings
Normally newlines and indents will resolve any conflict, but
if not, else associates to the right - it should be shifted, not cause
a reduce (which is the default anyway)
Signed-off-by: NeilBrown <neil@brown.name>
| IfStatement ${ $0 = $<1; }$
| Statement NEWLINE ${ $0 = $<1; }$
- IfStatement -> if Expression Block OptNL ${
+ $RIGHT else
+
+ IfStatement -> if Expression Block OptNL $$else ${
$0 = calloc(1, sizeof(struct statement));
$0->expr = $<2;
$0->thenpart = $<3;
}$
- | if Expression : SimpleStatements ${
+ | if Expression : SimpleStatements $$else ${
$0 = calloc(1, sizeof(struct statement));
$0->expr = $<2;
$0->thenpart = $<4;