diff options
author | Tucker Evans <tuckerevans24@gmail.com> | 2019-08-29 11:53:06 -0400 |
---|---|---|
committer | Tucker Evans <tuckerevans24@gmail.com> | 2019-08-29 11:53:06 -0400 |
commit | 227b13eccaecc05d76ca8dceb922a9d280ead0c4 (patch) | |
tree | 6f293ebb87d4aa36779c0f650826759ff567fcc1 /sem_check.c | |
parent | ec98dd863237aa4a1853e0efb589f2da597c5640 (diff) |
Fix return value for correctly typed statements
Change okay return value to 1 so 0 can be used to denote an unset
return type
Diffstat (limited to 'sem_check.c')
-rw-r--r-- | sem_check.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sem_check.c b/sem_check.c index 3d42996..c5e9fb6 100644 --- a/sem_check.c +++ b/sem_check.c @@ -107,7 +107,7 @@ ptree *t; yyerror("Incomplete parse tree\n"); if (t->l->ret_type == t->r->ret_type) - return 0; + return 1; else { snprintf(buf, 100, "Mismached types: " "Cannot assign type %s " @@ -142,13 +142,13 @@ ptree *t; if (t->l->ret_type != BOOL) yyerror("If condition must be of type BOOL\n"); - return 0; + return 1; 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); + snprintf(buf, 100, "Unknown tree node: %d...\n", t->type); yyerror(buf); } |