aboutsummaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-09-12 19:50:14 -0400
committerTucker Evans <tuckerevans24@gmail.com>2019-09-12 19:50:14 -0400
commit11b46650941f54bf7b95648de04c897656b9867b (patch)
treeba91e63ad94530905439f7daf7f2e8281efe8ada /scope.c
parent6130381c23c2ca4e050e83b7a20e3ba56d0fc283 (diff)
Fix setting type for multiple declared arrays
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/scope.c b/scope.c
index 9d9da5e..0355014 100644
--- a/scope.c
+++ b/scope.c
@@ -146,8 +146,15 @@ scope *s;
for (i = 0; i < HASH_SIZE; i++) {
for( tmp=s->table[i]; tmp; tmp = tmp->next) {
+ if(!tmp->array_info)
fprintf(stderr, "\t%s:%s\t", tmp->name,
pretty_type(tmp->var_type));
+ else
+ fprintf(stderr, "\t%s:%s [%d:%d]\t", tmp->name,
+ pretty_type(tmp->var_type),
+ tmp->array_info->start_idx,
+ tmp->array_info->start_idx
+ + tmp->array_info->size);
if (tmp->func_info && tmp->func_info->argv) {
for (int i = 0; i < tmp->func_info->argc; i++)
fprintf(stderr, " %s ", pretty_type(tmp->func_info->argv[i]));