summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaweł Dybiec <pdybiec@stud.cs.uni.wroc.pl>2018-11-08 19:07:17 +0100
committerPaweł Dybiec <pdybiec@stud.cs.uni.wroc.pl>2018-11-08 19:07:17 +0100
commit144d709c0232904802d31c8af5ca9f4047ccdb29 (patch)
treec9630a77877fca49d5732c9a9a7ae25930bd4d09
parentFix string lexing (diff)
Add bool expressions, fixed ambiguity with EOF
-rw-r--r--source/mod_student/parser.mly3
1 files changed, 1 insertions, 2 deletions
diff --git a/source/mod_student/parser.mly b/source/mod_student/parser.mly
index 7f9174a..ab095ef 100644
--- a/source/mod_student/parser.mly
+++ b/source/mod_student/parser.mly
@@ -61,8 +61,6 @@ let mkTag =
 file:
     | declarations= list(func) EOF
     { ModuleDefinition {global_declarations=declarations } }
-    |  EOF
-    { ModuleDefinition {global_declarations=[] } }
 
 func:
     | id=identifier LPAREN parameters=separated_list(COMMA,var_decl) RPAREN return=return_type body=option(statement_block)
@@ -159,6 +157,7 @@ expression_base:
     | node=expression_integer { node }
     | node=expression_char    { node }
     | node=expression_string  { node }
+    | node=expression_bool  { node }
     | node=expression_struct  { node }
     | LPAREN node=expression RPAREN { node }
 expression_identifier: