aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sem_check.c11
-rw-r--r--tree.c1
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;
}