public ModuleEntity fetchModule(String path) throws Throwable { return fetchModule(path, path.endsWith(".phb")); }
public ModuleEntity loadFrom(String file) throws Throwable { return environment.getModuleManager().fetchModule(file); }
private ModuleEntity compileFile(File path, File destinationDirectory, File destinationResDirectory) { try { ModuleEntity entity = env.getModuleManager().fetchModule(path.getPath()); saveModuleClasses(entity, destinationDirectory, destinationResDirectory); return entity; } catch (Throwable throwable) { throw new RuntimeException(throwable); } }
@Signature(@Arg("path")) public Memory findModule(Environment env, Memory... args) throws Throwable { ModuleManager moduleManager = this.environment.getModuleManager(); boolean hasModule = moduleManager.hasModule(args[0].toString()); if (hasModule) { return ObjectMemory.valueOf(new WrapModule(env, moduleManager.fetchModule(args[0].toString()))); } return Memory.NULL; }
private Memory __import(String path, ArrayMemory locals, TraceInfo trace, String funcName, boolean once, Callback<Void, Void> callback) throws Throwable { synchronized (moduleManager) { if (once && moduleManager.hasModule(path)) { return Memory.TRUE; } ModuleEntity module = moduleManager.fetchModule(path, path.endsWith(".phb")); if (module == null) { callback.call(null); return Memory.FALSE; } CallStackItem stackItem = pushCall( trace, null, new Memory[]{StringMemory.valueOf(path)}, funcName, null, null ); try { if (locals == null) { locals = new ArrayMemory(); } return module.include(this, locals); } finally { popCall(); } } }
ModuleEntity fetchModule = environment.getModuleManager().fetchModule(include);