use of org.luaj.vm2.LuaString in project LuaViewSDK by alibaba.
the class LexState method anchor_token.
/*----------------------------------------------------------------------
name args description
------------------------------------------------------------------------*/
void anchor_token() {
/* last token from outer function must be EOS */
LuaC._assert(fs != null || t.token == TK_EOS);
if (t.token == TK_NAME || t.token == TK_STRING) {
LuaString ts = t.seminfo.ts;
// TODO: is this necessary?
L.cachedLuaString(t.seminfo.ts);
}
}
use of org.luaj.vm2.LuaString in project LuaViewSDK by alibaba.
the class LexState method closegoto.
void closegoto(int g, Labeldesc label) {
FuncState fs = this.fs;
Labeldesc[] gl = this.dyd.gt;
Labeldesc gt = gl[g];
LuaC._assert(gt.name.eq_b(label.name));
if (gt.nactvar < label.nactvar) {
LuaString vname = fs.getlocvar(gt.nactvar).varname;
String msg = L.pushfstring("<goto " + gt.name + "> at line " + gt.line + " jumps into the scope of local '" + vname.tojstring() + "'");
semerror(msg);
}
fs.patchlist(gt.pc, label.pc);
/* remove goto from pending list */
System.arraycopy(gl, g + 1, gl, g, this.dyd.n_gt - g - 1);
gl[--this.dyd.n_gt] = null;
}
use of org.luaj.vm2.LuaString 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++;
}
use of org.luaj.vm2.LuaString in project LuaViewSDK by alibaba.
the class FuncState method checkrepeated.
// =============================================================
// from lparser.c
// =============================================================
/* check for repeated labels on the same block */
void checkrepeated(LexState.Labeldesc[] ll, int ll_n, LuaString label) {
int i;
for (i = bl.firstlabel; i < ll_n; i++) {
if (label.eq_b(ll[i].name)) {
String msg = ls.L.pushfstring("label '" + label + " already defined on line " + ll[i].line);
ls.semerror(msg);
}
}
}
use of org.luaj.vm2.LuaString in project LuaViewSDK by alibaba.
the class FuncState method newupvalue.
int newupvalue(LuaString name, expdesc v) {
checklimit(nups + 1, LUAI_MAXUPVAL, "upvalues");
if (f.upvalues == null || nups + 1 > f.upvalues.length)
f.upvalues = realloc(f.upvalues, nups > 0 ? nups * 2 : 1);
f.upvalues[nups] = new Upvaldesc(name, v.k == LexState.VLOCAL, v.u.info);
return nups++;
}
Aggregations