From c6d13abfc122c15ecc182b1fc5645628e8eb4d18 Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Thu, 5 Sep 2019 17:59:44 -0400 Subject: Add function argument types --- scope.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scope.c') diff --git a/scope.c b/scope.c index 00e2417..9d9da5e 100644 --- a/scope.c +++ b/scope.c @@ -146,8 +146,13 @@ scope *s; for (i = 0; i < HASH_SIZE; i++) { for( tmp=s->table[i]; tmp; tmp = tmp->next) { - fprintf(stderr, "\t%s:%s\n", tmp->name, + fprintf(stderr, "\t%s:%s\t", tmp->name, pretty_type(tmp->var_type)); + 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])); + } + fprintf(stderr, "\n"); } } } -- cgit v1.1 From 11b46650941f54bf7b95648de04c897656b9867b Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Thu, 12 Sep 2019 19:50:14 -0400 Subject: Fix setting type for multiple declared arrays --- scope.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scope.c') 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])); -- cgit v1.1