aboutsummaryrefslogtreecommitdiff
path: root/sem_check.c
diff options
context:
space:
mode:
Diffstat (limited to 'sem_check.c')
-rw-r--r--sem_check.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sem_check.c b/sem_check.c
index 4c8a0d3..64db636 100644
--- a/sem_check.c
+++ b/sem_check.c
@@ -127,9 +127,13 @@ ptree *t;
break;
}
- type = t->l->attr.nval -> var_type;
+ type = t->l->attr.nval->var_type;
if (type == ARRAY - INT || type == ARRAY - REAL)
return ARRAY - type;
+
+ snprintf(buf, 100, "%s is not an array (has type: %s)\n",
+ t->l->attr.nval->name,
+ pretty_type(type));
break;
case IF:
case WHILE: