diff options
author | Tucker Evans <tuckerevans24@gmail.com> | 2019-08-04 11:57:35 -0400 |
---|---|---|
committer | Tucker Evans <tuckerevans24@gmail.com> | 2019-08-04 11:57:35 -0400 |
commit | 204c5b9e1e870fde83b93b790d4695f478732e63 (patch) | |
tree | 9ac3d36437e73b3bf3bedbdf141ae0e01b95e7ff | |
parent | 89fca11404f818b1ece0abb03b42acbcb1f3a280 (diff) | |
parent | 081f3735abf4add6dbbd6ba4ca56da10bd54139e (diff) |
Merge branch 'scopes' into types
-rw-r--r-- | pc.y | 4 | ||||
-rw-r--r-- | scope.c | 7 |
2 files changed, 8 insertions, 3 deletions
@@ -260,12 +260,12 @@ TD: TO | DT; var :ID { - $$ = mkid(scope_insert(cur_scope,$1)); + $$ = mkid(scope_safe_search_all(cur_scope,$1)); } |ID '[' expr ']' { node* tmp; - tmp = scope_insert(cur_scope, $1); + tmp = scope_safe_search_all(cur_scope, $1); $$ = mktree(ARRAY_ACCESS, mkid(tmp), $3); } @@ -138,9 +138,14 @@ scope *s; { int i; node * tmp; + + fprintf(stderr, "\n\nSCOPE\n" + "==========================================================\n"); + for (i = 0; i < HASH_SIZE; i++) { for( tmp=s->table[i]; tmp; tmp = tmp->next) { - fprintf(stderr, "\t%s\n", tmp->name); + fprintf(stderr, "\t%s:%s\n", tmp->name, + pretty_type(tmp->var_type)); } } } |