summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaweł Dybiec <pdybiec@stud.cs.uni.wroc.pl>2018-11-09 00:19:49 +0100
committerPaweł Dybiec <pdybiec@stud.cs.uni.wroc.pl>2018-11-09 00:19:49 +0100
commit9dadd898059a3c44f225ac5c6c4e16063b7db57d (patch)
treead71f1c45ddd5de6a1e76a13471e238f62cbccf8
parentAdd bool expressions, fixed ambiguity with EOF (diff)
Proper handling of semicolons
-rw-r--r--source/mod_student/parser.mly4
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 }