public listcode(LuaTable table, int id, String name) { super.opcode = id; super.name = name; table.set(name, this); }
public LuaValue call(LuaValue env) { LuaTable meta = new LuaTable(0,1); meta.set("__tostring", new tostring()); LuaTable table = new LuaTable(0,10); table.setmetatable(meta); table.set("read", new read()); table.set("readable", new readable()); table.set("writeable", new writeable()); table.set("write", new write()); instance.registerPackage("stream", table); return table; }
public listcode(LuaTable table, int id, String name) { super.opcode = id; super.name = name; table.set(name, this); }
public LuaValue call(LuaValue env) { LuaTable meta = new LuaTable(); meta.set("__index", new index()); LuaTable table = new LuaTable(); table.setmetatable(meta); instance.registerPackage("aerospike", table); return table; }
public bytesbool(LuaTable table, int id, String name) { super.opcode = id; super.name = name; table.set(name, this); }
public mapcode(LuaTable table, int id, String name) { super.opcode = id; super.name = name; table.set(name, this); }
private LuaTable stats() { LuaTable stats = new LuaTable(); stats.set("pages", 0); // (int)SiteStats::pages(), stats.set("articles", 0); // (int)SiteStats::articles(), stats.set("files", 0); // (int)SiteStats::images(), stats.set("edits", 0); // (int)SiteStats::edits(), stats.set("views", NIL); // $wgDisableCounters ? null : (int)SiteStats::views(), stats.set("users", 0); // (int)SiteStats::users(), stats.set("activeUsers", 0); // (int)SiteStats::activeUsers(), stats.set("admins", 0); // (int)SiteStats::numberingroup( 'sysop' ), return stats; }
/** Set the lua path used by this library instance to a new value. * Merely sets the value of {@link path} to be used in subsequent searches. */ public void setLuaPath( String newLuaPath ) { package_.set(_PATH, LuaValue.valueOf(newLuaPath)); }
@Override public LuaValue getSetupOptions() { LuaTable options = new LuaTable(); options.set("lang", "en"); return options; }
/** Set the lua path used by this library instance to a new value. * Merely sets the value of {@link path} to be used in subsequent searches. */ public void setLuaPath( String newLuaPath ) { package_.set(_PATH, LuaValue.valueOf(newLuaPath)); }
@Override public LuaTable getEnv(){ LuaTable table = new LuaTable(); for( Map.Entry<String, String> entry : mMapEnvironment.entrySet() ){ table.set(LuaString.valueOf(entry.getKey()), LuaString.valueOf(entry.getValue())); } return table; }
@Override public LuaTable getEnv(){ LuaTable table = new LuaTable(); for( Map.Entry<String, String> entry : mMapEnvironment.entrySet() ){ table.set(LuaString.valueOf(entry.getKey()), LuaString.valueOf(entry.getValue())); } return table; }
@Override public LuaValue call(LuaValue action) { LuaTable table = new LuaTable(); table.set("restrictions", new LuaTable()); return table; } };
@Override public LuaValue call(LuaValue var1, LuaValue var2) { LuaTable functions = new LuaTable(); functions.set("getRapidView", new GetPhotonView()); functions.set("getJavaBridge", new GetJavaBridge()); functions.set("getEnvironment", new GetEnvironment()); var2.set("rapid", functions); var2.get("package").get("loaded").set("rapid", functions); return functions; }
private void loadSystemPackage(ClassLoader resourceLoader, String packageName) { String resourcePath = "udf/" + packageName + ".lua"; Prototype prototype = LuaCache.loadPackageFromResource(resourceLoader, resourcePath, packageName); LuaClosure function = new LuaClosure(prototype, globals); function.invoke(); loadedTable.set(packageName, LuaValue.TRUE); }
private static LuaTable arrayToTable(Object[] arrayObj){ LuaTable table = new LuaTable(); for( int i = 0; i < arrayObj.length; i++ ){ table.set( LuaInteger.valueOf( i + 1), CoerceJavaToLua.coerce(arrayObj[i])); } return table; } }