Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

resolve dangling else shift/reduce conflict in example

  • Loading branch information...
commit 7991e1c6ae139f3f7442458c27db4e8b9f381c54 1 parent 800e1d4
@zaach authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 examples/ansic.jison
View
5 examples/ansic.jison
@@ -10,6 +10,9 @@
%token CASE DEFAULT IF ELSE SWITCH WHILE DO FOR GOTO CONTINUE BREAK RETURN
+%nonassoc IF_WITHOUT_ELSE
+%nonassoc ELSE
+
%start translation_unit
%%
@@ -377,7 +380,7 @@ expression_statement
;
selection_statement
- : IF '(' expression ')' statement
+ : IF '(' expression ')' statement %prec IF_WITHOUT_ELSE
| IF '(' expression ')' statement ELSE statement
| SWITCH '(' expression ')' statement
;
Please sign in to comment.
Something went wrong with that request. Please try again.