From 7449656c35052b29c65f0b7b53895b22b958a259 Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Sat, 17 Aug 2019 12:16:17 -0400 Subject: Fix error message for ADDOP/MULOP Removes some debugging prints --- sem_check.c | 11 ++++++++--- tree.c | 1 - 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sem_check.c b/sem_check.c index 2e9b5ba..da54a21 100644 --- a/sem_check.c +++ b/sem_check.c @@ -58,8 +58,14 @@ ptree *t; if (t->r->ret_type == t->l->ret_type) return t->r->ret_type; - else - yyerror("Misssing nodes\n"); + else { + snprintf(buf, 100, "Mismached types: " + "Type %s " + "cannot be used with type %s\n", + pretty_type(t->r->ret_type), + pretty_type(t->l->ret_type)); + yyerror(buf); + } break; case RELOP : if (!(t->r && t->l)) @@ -81,7 +87,6 @@ ptree *t; case RNUM: return REAL; case ASSIGNOP: - fprintf(stderr, "HERE\n"); if (!(t->r && t->l && t->r->attr.nval)) yyerror("Incomplete parse tree\n"); diff --git a/tree.c b/tree.c index eead0e5..11c08d4 100644 --- a/tree.c +++ b/tree.c @@ -87,7 +87,6 @@ void set_ret_type(t) ptree *t; { if (!t){ - fprintf(stderr, "TEST\n"); return; } -- cgit v1.1