aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-08-18 18:14:11 -0400
committerTucker Evans <tuckerevans24@gmail.com>2019-08-18 18:14:11 -0400
commitfe712311578b014a9e074f25856520732a1b3da8 (patch)
treef76641917ea7a14fe110677f1c82a889b37cac59
parentee21031fb16f5ed89dd1dbaf73bc2a1201f955b1 (diff)
Add while (and holding place for for) type checking
-rw-r--r--sem_check.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sem_check.c b/sem_check.c
index d18fb59..c6f4c4e 100644
--- a/sem_check.c
+++ b/sem_check.c
@@ -138,13 +138,16 @@ ptree *t;
return ARRAY - type;
break;
case IF:
+ case WHILE:
if (!(t->r && t->l))
yyerror("Incomplete parse tree\n");
if (t->l->ret_type != BOOL)
yyerror("If condition must be of type BOOL\n");
return 0;
-
+ case FOR:
+ /*TODO add for type checking after parsing is correct*/
+ break;
default:
return -200;
snprintf(buf, 101, "Unknown tree node: %d...\n", t->type);