fix scope bug

This commit is contained in:
zongor 2026-07-04 19:15:26 -07:00
parent 7232f95f7a
commit 6fb3f2d6a6
1 changed files with 3 additions and 3 deletions

View File

@ -54,10 +54,9 @@ scope_pop(void)
void
scope_push(void)
{
Scope *scope = List_get(parser->scopes, parser->scope_idx);
parser->current_scope = scope;
parser->depth++;
parser->scope_idx++;
parser->depth++;
parser->current_scope = (Scope *)List_get(parser->scopes, parser->scope_idx);
}
Symbol *
@ -1144,6 +1143,7 @@ compile(Arena *a, List *c, List *m, Emitter *e, char *source)
parser->pass++;
parser->depth = 0;
parser->scope_idx = 0;
parser->current_scope = List_get(parser->scopes, 0);
emit_program(source);
return true;