feat: replace module import string operand with direct ObjModule reference in IMPORT_VARIABLE
Add CODE_END_MODULE opcode to store the current ObjModule in vm->lastModule after module body execution. Modify IMPORT_VARIABLE to load variables from vm->lastModule instead of using a constant string operand for the module name. Update opcode definitions, debug dump, compiler import logic, and interpreter dispatch accordingly. Refactor variable lookup into getModuleVariable helper. Adjust formatting in wren_primitive.c and wren_opt_meta.c.
This commit is contained in:
+2
-1
@@ -91,7 +91,8 @@ static WrenForeignClassMethods bindForeignClass(
|
||||
return methods;
|
||||
}
|
||||
|
||||
static void afterLoad(WrenVM* vm) {
|
||||
static void afterLoad(WrenVM* vm)
|
||||
{
|
||||
if (strstr(testName, "/call.wren") != NULL)
|
||||
{
|
||||
callRunTests(vm);
|
||||
|
||||
Reference in New Issue
Block a user