diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-04-07 01:28:45 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-04-07 01:28:45 +0300 |
| commit | 170f3ddc3d8967c0b5d4755c0221c396db215b2f (patch) | |
| tree | 00314209cd7878b9d5b3fe6fc2e0c7297f76dec8 /src/scope.c | |
| parent | 2bdf1f8b1856bca8091d66a7a447e6c90993c297 (diff) | |
| download | ek-170f3ddc3d8967c0b5d4755c0221c396db215b2f.tar.gz ek-170f3ddc3d8967c0b5d4755c0221c396db215b2f.zip | |
implement some initial qbt backend stuff
Diffstat (limited to 'src/scope.c')
| -rw-r--r-- | src/scope.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/scope.c b/src/scope.c index 48d3bc5..205e858 100644 --- a/src/scope.c +++ b/src/scope.c @@ -32,7 +32,7 @@ struct scope *create_scope() return scope; } -void destroy_visible(struct scope *scope, struct visible *visible) +void destroy_visible(struct visible *visible) { struct visible *prev = visible, *cur; if (prev) @@ -53,10 +53,10 @@ void destroy_scope(struct scope *scope) free((void *)scope->fctx.fname); } - destroy_visible(scope, scope->vars); - destroy_visible(scope, scope->procs); - destroy_visible(scope, scope->macros); - destroy_visible(scope, scope->types); + destroy_visible(scope->vars); + destroy_visible(scope->procs); + destroy_visible(scope->macros); + destroy_visible(scope->types); struct scope *prev = scope->children, *cur; if (prev) @@ -179,7 +179,8 @@ int scope_add_type(struct scope *scope, struct ast_node *id, int scope_add_macro(struct scope *scope, struct ast_node *macro) { assert(macro->node_type == AST_MACRO_CONSTRUCT); - struct ast_node *exists = file_scope_find_macro(scope, AST_MACRO_CONSTRUCT( + struct ast_node *exists = file_scope_find_macro(scope, + AST_MACRO_CONSTRUCT( macro).id); if (exists) { semantic_error(scope->fctx, macro, "macro redefined"); @@ -362,7 +363,7 @@ static int add_actual(struct actual *actuals, struct ast_node *node) return 0; } - /* TODO: check that there isn't already an actual like ours? */ + /* TODO: check that there isn't already an actual like ours */ struct actual *actual = calloc(1, sizeof(struct actual)); if (!actual) return -1; |
