diff options
-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)); } } } |