Search in sources :

Example 1 with LocVars

use of org.luaj.vm2.LocVars in project LuaViewSDK by alibaba.

the class LexState method registerlocalvar.

int registerlocalvar(LuaString varname) {
    FuncState fs = this.fs;
    Prototype f = fs.f;
    if (f.locvars == null || fs.nlocvars + 1 > f.locvars.length)
        f.locvars = LuaC.realloc(f.locvars, fs.nlocvars * 2 + 1);
    f.locvars[fs.nlocvars] = new LocVars(varname, 0, 0);
    return fs.nlocvars++;
}
Also used : Prototype(org.luaj.vm2.Prototype) LocVars(org.luaj.vm2.LocVars)

Example 2 with LocVars

use of org.luaj.vm2.LocVars in project LuaViewSDK by alibaba.

the class DumpState method dumpDebug.

void dumpDebug(final Prototype f) throws IOException {
    int i, n;
    if (strip)
        dumpInt(0);
    else
        dumpString(f.source);
    n = strip ? 0 : f.lineinfo.length;
    dumpInt(n);
    for (i = 0; i < n; i++) dumpInt(f.lineinfo[i]);
    n = strip ? 0 : f.locvars.length;
    dumpInt(n);
    for (i = 0; i < n; i++) {
        LocVars lvi = f.locvars[i];
        dumpString(lvi.varname);
        dumpInt(lvi.startpc);
        dumpInt(lvi.endpc);
    }
    n = strip ? 0 : f.upvalues.length;
    dumpInt(n);
    for (i = 0; i < n; i++) dumpString(f.upvalues[i].name);
}
Also used : LocVars(org.luaj.vm2.LocVars)

Aggregations

LocVars (org.luaj.vm2.LocVars)2 Prototype (org.luaj.vm2.Prototype)1