diff options
author | Paweł Dybiec <pdybiec@stud.cs.uni.wroc.pl> | 2018-11-09 00:19:49 +0100 |
---|---|---|
committer | Paweł Dybiec <pdybiec@stud.cs.uni.wroc.pl> | 2018-11-09 00:19:49 +0100 |
commit | 9dadd898059a3c44f225ac5c6c4e16063b7db57d (patch) | |
tree | ad71f1c45ddd5de6a1e76a13471e238f62cbccf8 /source | |
parent | Add bool expressions, fixed ambiguity with EOF (diff) |
Proper handling of semicolons
Diffstat (limited to 'source')
-rw-r--r-- | source/mod_student/parser.mly | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/mod_student/parser.mly b/source/mod_student/parser.mly index ab095ef..7949ec8 100644 --- a/source/mod_student/parser.mly +++ b/source/mod_student/parser.mly @@ -185,7 +185,7 @@ expression_length: { EXPR_Length { tag=mkTag (); loc=mkLocation $startpos; arg=argument } } statement_block: - | LBRACKET body=append(terminated(separated_list(semicolons,statement),semicolons),loption(terminated(return_stmt,semicolons))) RBRACKET + | LBRACKET body=append(list(terminated(statement,semicolons)),loption(terminated(return_stmt,semicolons))) RBRACKET { STMTBlock { loc=mkLocation $startpos;body=body } } statement: | left=lvalue ASSIGN right=expression { STMT_Assign {loc=mkLocation $startpos; @@ -219,7 +219,7 @@ lvalue_index: | sub=lvalue_index LSBRACKET index=expression RSBRACKET {EXPR_Index {tag=mkTag (); loc=mkLocation $startpos; expr=sub; index=index} } semicolons: - | list(SEMICOLON) {} + | option(SEMICOLON) {} identifier: | IDENTIFIER { Identifier $1 } |