From 9dadd898059a3c44f225ac5c6c4e16063b7db57d Mon Sep 17 00:00:00 2001 From: Paweł Dybiec Date: Fri, 9 Nov 2018 00:19:49 +0100 Subject: Proper handling of semicolons --- source/mod_student/parser.mly | 4 ++-- 1 file 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 } -- cgit 1.4.1