aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-08-17 13:04:08 -0400
committerTucker Evans <tuckerevans24@gmail.com>2019-08-17 13:04:08 -0400
commit47016c39ed801aecfa900f30a49d94ae247b1156 (patch)
treeb8ac7aeeef51d3218defd647676df4ff0f107178
parent7a1850b859041a990ab93416f7b3d76a5d946191 (diff)
Fix error messages for RELOP type checking
Removes debug prints
-rw-r--r--sem_check.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sem_check.c b/sem_check.c
index da54a21..44eb82f 100644
--- a/sem_check.c
+++ b/sem_check.c
@@ -74,7 +74,12 @@ ptree *t;
if (t->r->ret_type == t->l->ret_type)
return BOOL;
else
- yyerror("Misssing nodes\n");
+ snprintf(buf, 100, "Mismached types: "
+ "Type %s "
+ "cannot be compared to type %s\n",
+ pretty_type(t->r->ret_type),
+ pretty_type(t->l->ret_type));
+ yyerror(buf);
break;
case NOT:
if (t->ret_type == BOOL)
@@ -82,7 +87,6 @@ ptree *t;
yyerror("NOT needs bool input\n");
break;
case INUM:
- printf("INUM: %d", t->attr.ival);
return INT;
case RNUM:
return REAL;