Fix conflicts by introducing a CASE_END token.

This commit is contained in:
Stefano Sanfilippo 2014-11-23 19:24:10 +01:00
parent 2da9bdbb79
commit d9f3d6f06a
2 changed files with 5 additions and 2 deletions

View File

@ -144,6 +144,9 @@ CHAR [a-zA-Z_]
"avvertite don ulrico" { "avvertite don ulrico" {
return ABORT; return ABORT;
} }
"..." {
return CASE_END;
}
[ \t\f\v] {} [ \t\f\v] {}

View File

@ -20,7 +20,7 @@ extern void emit(const char *, ...);
%token PRINT INPUT %token PRINT INPUT
%token ASSERT_BEGIN ASSERT_END %token ASSERT_BEGIN ASSERT_END
%token LOOP_BEGIN LOOP_CONDITION %token LOOP_BEGIN LOOP_CONDITION
%token BRANCH_CONDITION BRANCH_BEGIN BRANCH_ELSE BRANCH_END %token BRANCH_CONDITION BRANCH_BEGIN BRANCH_ELSE BRANCH_END CASE_END
%token COLON COMMA LCURL RCURL %token COLON COMMA LCURL RCURL
%token FUNDECL PARAMS FUNCALL %token FUNDECL PARAMS FUNCALL
%token ABORT %token ABORT
@ -111,7 +111,7 @@ cases:
case_stmt | case_stmt cases case_stmt | case_stmt cases
; ;
case_stmt: case_stmt:
expression COLON NEWLINE statements expression COLON NEWLINE statements CASE_END
; ;
fun_call: fun_call:
FUNCALL ID args FUNCALL ID args