diff options
author | Paweł Dybiec <pdybiec@stud.cs.uni.wroc.pl> | 2018-11-10 01:14:39 +0100 |
---|---|---|
committer | Paweł Dybiec <pdybiec@stud.cs.uni.wroc.pl> | 2018-11-10 01:14:39 +0100 |
commit | 580dc4f693bad1ae0caa8809673f955f13aad4c2 (patch) | |
tree | d1aa880ff0a02b4ec5107c616033ab178f29023c /source/mod_student/parser.mly | |
parent | Support multiple indexing (diff) |
Add boolean literals
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 |