From fe712311578b014a9e074f25856520732a1b3da8 Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Sun, 18 Aug 2019 18:14:11 -0400 Subject: Add while (and holding place for for) type checking --- sem_check.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- cgit v1.1