From 47016c39ed801aecfa900f30a49d94ae247b1156 Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Sat, 17 Aug 2019 13:04:08 -0400 Subject: Fix error messages for RELOP type checking Removes debug prints --- sem_check.c | 8 ++++++-- 1 file 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; -- cgit v1.1