/** * Load a function prototype from the input stream * @param p name of the source * @return {@link Prototype} instance that was loaded * @throws IOException */ public Prototype loadFunction(LuaString p) throws IOException { Prototype f = new Prototype(); //// this.L.push(f); // f.source = loadString(); // if ( f.source == null ) // f.source = p; f.linedefined = loadInt(); f.lastlinedefined = loadInt(); f.numparams = is.readUnsignedByte(); f.is_vararg = is.readUnsignedByte(); f.maxstacksize = is.readUnsignedByte(); f.code = loadIntArray(); loadConstants(f); loadUpvalues(f); loadDebug(f); // TODO: add check here, for debugging purposes, I believe // see ldebug.c // IF (!luaG_checkcode(f), "bad code"); // this.L.pop(); return f; }
/** * Load a function prototype from the input stream * @param p name of the source * @return {@link Prototype} instance that was loaded * @throws IOException */ public Prototype loadFunction(LuaString p) throws IOException { Prototype f = new Prototype(); //// this.L.push(f); // f.source = loadString(); // if ( f.source == null ) // f.source = p; f.linedefined = loadInt(); f.lastlinedefined = loadInt(); f.numparams = is.readUnsignedByte(); f.is_vararg = is.readUnsignedByte(); f.maxstacksize = is.readUnsignedByte(); f.code = loadIntArray(); loadConstants(f); loadUpvalues(f); loadDebug(f); // TODO: add check here, for debugging purposes, I believe // see ldebug.c // IF (!luaG_checkcode(f), "bad code"); // this.L.pop(); return f; }