fix scope bug
This commit is contained in:
parent
7232f95f7a
commit
6fb3f2d6a6
|
|
@ -54,10 +54,9 @@ scope_pop(void)
|
||||||
void
|
void
|
||||||
scope_push(void)
|
scope_push(void)
|
||||||
{
|
{
|
||||||
Scope *scope = List_get(parser->scopes, parser->scope_idx);
|
|
||||||
parser->current_scope = scope;
|
|
||||||
parser->depth++;
|
|
||||||
parser->scope_idx++;
|
parser->scope_idx++;
|
||||||
|
parser->depth++;
|
||||||
|
parser->current_scope = (Scope *)List_get(parser->scopes, parser->scope_idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
Symbol *
|
Symbol *
|
||||||
|
|
@ -1144,6 +1143,7 @@ compile(Arena *a, List *c, List *m, Emitter *e, char *source)
|
||||||
parser->pass++;
|
parser->pass++;
|
||||||
parser->depth = 0;
|
parser->depth = 0;
|
||||||
parser->scope_idx = 0;
|
parser->scope_idx = 0;
|
||||||
|
parser->current_scope = List_get(parser->scopes, 0);
|
||||||
emit_program(source);
|
emit_program(source);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue