feat: add logical import support with wren_modules directory resolution and path type classification
Introduce a path type classification system (absolute, relative, simple) to distinguish logical imports from relative ones. Implement automatic discovery of a "wren_modules" directory by walking up from the root directory. Refactor the CLI to return interpret results and exit codes instead of exiting directly. Extract cross-platform stat macros into a shared header. Update test API calls to use explicit relative paths.
This commit is contained in:
+2
-2
@@ -723,7 +723,7 @@ static Value resolveModule(WrenVM* vm, Value name)
|
||||
return name;
|
||||
}
|
||||
|
||||
Value wrenImportModule(WrenVM* vm, Value name)
|
||||
static Value importModule(WrenVM* vm, Value name)
|
||||
{
|
||||
name = resolveModule(vm, name);
|
||||
|
||||
@@ -1308,7 +1308,7 @@ static WrenInterpretResult runInterpreter(WrenVM* vm, register ObjFiber* fiber)
|
||||
{
|
||||
Value name = fn->constants.data[READ_SHORT()];
|
||||
|
||||
Value result = wrenImportModule(vm, name);
|
||||
Value result = importModule(vm, name);
|
||||
if (!IS_NULL(fiber->error)) RUNTIME_ERROR();
|
||||
|
||||
// Make a slot on the stack for the module's closure to place the return
|
||||
|
||||
Reference in New Issue
Block a user