aboutsummaryrefslogtreecommitdiff
path: root/sem_check.c
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-09-02 13:34:06 -0400
committerTucker Evans <tuckerevans24@gmail.com>2019-09-03 16:26:04 -0400
commit4fced0fc39d3aeacb3c6d434aeeb622468a857cc (patch)
treec92a2fa59466efd83d58448159c959ae5ae97343 /sem_check.c
parent389c2765afebb0b6112493e53117405488a4f3f1 (diff)
Add unary minus to parsing
Diffstat (limited to 'sem_check.c')
-rw-r--r--sem_check.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sem_check.c b/sem_check.c
index 773c70a..aa83155 100644
--- a/sem_check.c
+++ b/sem_check.c
@@ -54,7 +54,7 @@ ptree *t;
if (!(t->r && t->l))
yyerror("Missing nodes\n");
- if (t->attr.opval == ADD || t->attr.opval == OR) {
+ if (t->attr.opval == AND || t->attr.opval == OR) {
if(t->l->ret_type == BOOL && t->r->ret_type ==BOOL)
return BOOL;
else {
@@ -162,6 +162,8 @@ ptree *t;
if (t->l->ret_type == 1 && t->r->ret_type == INT)
return 1;
snprintf(buf, 100, "Incorrect types HERE...\n");
+ case SUB:
+ return t->l->ret_type;
break;
default:
return -200;