diff options
author | Tucker Evans <tuckerevans24@gmail.com> | 2019-08-17 12:16:17 -0400 |
---|---|---|
committer | Tucker Evans <tuckerevans24@gmail.com> | 2019-08-17 12:16:17 -0400 |
commit | 7449656c35052b29c65f0b7b53895b22b958a259 (patch) | |
tree | 1825fe336c74227fa260e6b2c0dfb994bba8d763 | |
parent | bddc723d0eb67b32bf50e2eabe4999dc96e741f3 (diff) |
Fix error message for ADDOP/MULOP
Removes some debugging prints
-rw-r--r-- | sem_check.c | 11 | ||||
-rw-r--r-- | 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"); @@ -87,7 +87,6 @@ void set_ret_type(t) ptree *t; { if (!t){ - fprintf(stderr, "TEST\n"); return; } |