diff options
Diffstat (limited to 'source/mod_student/parser.mly')
-rw-r--r-- | source/mod_student/parser.mly | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/source/mod_student/parser.mly b/source/mod_student/parser.mly index c79181e..2665861 100644 --- a/source/mod_student/parser.mly +++ b/source/mod_student/parser.mly @@ -195,7 +195,7 @@ statement: {STMT_VarDecl { var=var;init=init } } | WHILE cond=expression body=statement { STMT_While {loc=mkLocation $startpos;cond=cond;body=body } } - | IF cond=expression then_branch=statement else_branch=option(preceded(ELSE,statement)) + | IF cond=expression then_branch=statement else_branch=option(preceded(ELSE,statement)) (*Menhir attempts to mimic ocamlyacc’s specification, that is, to resolve shift/reduce conflicts in favor of shifting*) { STMT_If {loc=mkLocation $startpos;cond=cond;then_branch=then_branch; else_branch=else_branch } } | head=option_var_decl COMMA tail=separated_nonempty_list(COMMA, option_var_decl) ASSIGN call=call @@ -207,7 +207,6 @@ call: | callee=identifier LPAREN arguments=separated_list(COMMA,expression) RPAREN { Call { tag=mkTag (); loc=mkLocation $startpos; callee=callee; arguments=arguments } } - (* TODO Add other statements *) lvalue: | id=identifier {LVALUE_Id {loc=mkLocation $startpos;id=id} } | sub=lvalue_index LSBRACKET index=expression RSBRACKET |