diff options
| author | Paul Buetow <paul@buetow.org> | 2008-10-25 22:44:53 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2008-10-25 22:44:53 +0000 |
| commit | 380eacd0f4037ec00f37ad5b5e4baa18301cf3dd (patch) | |
| tree | 524ad303295c77d168d2106876b5965595fb264a /src/core | |
| parent | 4aeb6d5394e7c65b8c43b71908d85ef8cfe41c3a (diff) | |
small cosmetic fixes
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/scope.c | 7 | ||||
| -rw-r--r-- | src/core/scope.h | 1 | ||||
| -rw-r--r-- | src/core/token.c | 5 |
3 files changed, 9 insertions, 4 deletions
diff --git a/src/core/scope.c b/src/core/scope.c index 0c920c4..2a19390 100644 --- a/src/core/scope.c +++ b/src/core/scope.c @@ -148,3 +148,10 @@ scope_newset(Scope *p_scope, char *c_key, Symbol *p_symbol) { return (true); } + +void +scopes_print(Scope *p_scope) { + printf("Scopes:\n"); + printf("Scope stack size: %d\n", p_scope->p_stack_scopes); + +} diff --git a/src/core/scope.h b/src/core/scope.h index 1bf0c51..be29e67 100644 --- a/src/core/scope.h +++ b/src/core/scope.h @@ -55,5 +55,6 @@ _Bool scope_newset(Scope *p_scope, char *c_key, Symbol *p_symbol); _Bool scope_reset(Scope *p_scope, char *c_key, Symbol *p_symbol); void scope_down(Scope *p_scope); void scope_up(Scope *p_scope); +void scope_print(Scope *p_scope); #endif /* SCOPE_H */ diff --git a/src/core/token.c b/src/core/token.c index f7955fc..71d9551 100644 --- a/src/core/token.c +++ b/src/core/token.c @@ -300,14 +300,11 @@ token_new_copy(Token *p_token) { void token_copy_vals(Token *p_token_to, Token *p_token_from) { int i_len; - // TODO: Check against mem leak - // if (p_token_to->c_val) - // free(p_token_to->c_val); - if (p_token_from->c_val) { i_len = strlen(p_token_from->c_val); p_token_to->c_val = calloc(i_len+1, sizeof(char)); strcpy(p_token_to->c_val, p_token_from->c_val); + } else { p_token_to->c_val = NULL; } |
