Skip to content

Commit

Permalink
Minor updates and fixes to import in local scope
Browse files Browse the repository at this point in the history
  • Loading branch information
mcfriend99 committed Feb 9, 2025
1 parent 8959961 commit 2633a19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2583,15 +2583,15 @@ void register_module__FILE__(b_vm *vm, b_obj_module *module) {
// register module __file__
push(vm, STRING_L_VAL("__file__", 8));
push(vm, STRING_VAL(module->file));
table_set(vm, &module->values, vm->stack[0], vm->stack[1]);
table_set(vm, &module->values, peek(vm, 1), peek(vm, 0));
pop_n(vm, 2);
}

void register__ROOT__(b_vm *vm) {
// register module __file__
push(vm, STRING_L_VAL("__root__", 8));
push(vm, STRING_VAL(vm->root_file));
table_set(vm, &vm->globals, vm->stack[0], vm->stack[1]);
table_set(vm, &vm->globals, peek(vm, 1), peek(vm, 0));
pop_n(vm, 2);
}

Expand Down

0 comments on commit 2633a19

Please sign in to comment.