Go to the documentation of this file.
38 #define hasmultret(k) ((k) == VCALL || (k) == VVARARG)
43 #define eqstr(a,b) ((a) == (b))
78 const char *where = (line == 0)
122 #define check_condition(ls,c,msg) { if (!(c)) luaX_syntaxerror(ls, msg); }
131 if (l_unlikely(!
testnext(ls, what))) {
136 "%s expected (to close %s at line %d)",
177 int oldsize =
f->sizelocvars;
179 LocVar, SHRT_MAX,
"local variables");
180 while (oldsize < f->sizelocvars)
181 f->locvars[oldsize++].varname = NULL;
208 #define new_localvarliteral(ls,v) \
210 luaX_newstring(ls, "" v, (sizeof(v)/sizeof(char)) - 1));
269 e->
u.
var.vidx = vidx;
288 varname = vardesc->
vd.
name;
302 "attempt to assign to const variable '%s'",
getstr(varname));
315 for (i = 0; i < nvars; i++) {
330 while (fs->
nactvar > tolevel) {
345 for (i = 0; i < fs->
nups; i++) {
346 if (
eqstr(up[i].name, name))
return i;
354 int oldsize =
f->sizeupvalues;
358 while (oldsize < f->sizeupvalues)
359 f->upvalues[oldsize++].name = NULL;
360 return &
f->upvalues[fs->
nups++];
472 int needed = nvars - nexps;
474 int extra = needed + 1;
492 #define enterlevel(ls) luaE_incCstack(ls->L)
495 #define leavelevel(ls) ((ls)->L->nCcalls--)
504 const char *
msg =
"<goto %s> at line %d jumps into the scope of local '%s'";
523 for (i = g; i < gl->
n - 1; i++)
524 gl->
arr[i] = gl->
arr[i + 1];
620 for (i = bl->
firstgoto; i < gl->n; i++) {
649 msg =
"break outside loop at line %d";
653 msg =
"no visible label '%s' for <goto> at line %d";
691 if (fs->
np >=
f->sizep) {
692 int oldsize =
f->sizep;
694 while (oldsize < f->sizep)
695 f->p[oldsize++] = NULL;
929 if (ls->
t.
token ==
'}')
break;
968 }
while (!isvararg &&
testnext(ls,
','));
1050 nparams = fs->
freereg - (base+1);
1161 "cannot use '...' outside a vararg function");
1225 static const struct {
1233 {6, 6}, {4, 4}, {5, 5},
1236 {3, 3}, {3, 3}, {3, 3},
1237 {3, 3}, {3, 3}, {3, 3},
1241 #define UNARY_PRIORITY 12
1323 for (; lh; lh = lh->
prev) {
1329 lh->
v.
u.
ind.t = extra;
1335 lh->
v.
u.
ind.t = extra;
1341 lh->
v.
u.
ind.idx = extra;
1438 if (l_unlikely(lb != NULL)) {
1439 const char *
msg =
"label '%s' already defined on line %d";
1464 condexit =
cond(ls);
1486 condexit =
cond(ls);
1520 int offset =
dest - (pc + 1);
1576 forbody(ls, base, line, 1, 0);
1604 forbody(ls, base, line, nvars - 4, 1);
1617 case '=':
fornum(ls, varname, line);
break;
1694 if (strcmp(attr,
"const") == 0)
1696 else if (strcmp(attr,
"close") == 0)
1731 luaK_semerror(ls,
"multiple to-be-closed variables in local list");
1732 toclose = fs->
nactvar + nvars;
1743 if (nvars == nexps &&
1762 while (ls->
t.
token ==
'.')
1764 if (ls->
t.
token ==
':') {
1778 body(ls, &b, ismethod, line);
1932 Dyndata *dyd,
const char *name,
int firstchar) {
1945 lexstate.
buff = buff;
void luaX_next(LexState *ls)
static void setvararg(FuncState *fs, int nparams)
int luaK_exp2anyreg(FuncState *fs, expdesc *e)
void luaK_goiffalse(FuncState *fs, expdesc *e)
LClosure * luaY_parser(lua_State *L, ZIO *z, Mbuffer *buff, Dyndata *dyd, const char *name, int firstchar)
auto first(const T &value, const Tail &...) -> const T &
static void restassign(LexState *ls, struct LHS_assign *lh, int nvars)
void luaK_fixline(FuncState *fs, int line)
static Upvaldesc * allocupvalue(FuncState *fs)
static l_noret jumpscopeerror(LexState *ls, Labeldesc *gt)
static void check_readonly(LexState *ls, expdesc *e)
static void localstat(LexState *ls)
static void codename(LexState *ls, expdesc *e)
const char * luaX_token2str(LexState *ls, int token)
static void simpleexp(LexState *ls, expdesc *v)
void luaX_setinput(lua_State *L, LexState *ls, ZIO *z, TString *source, int firstchar)
#define new_localvarliteral(ls, v)
static void close_func(LexState *ls)
void luaK_patchlist(FuncState *fs, int list, int target)
#define luaK_jumpto(fs, t)
static int searchupvalue(FuncState *fs, TString *name)
static void enterblock(FuncState *fs, BlockCnt *bl, lu_byte isloop)
#define luaC_objbarrier(L, p, o)
static void exp1(LexState *ls)
void luaK_setlist(FuncState *fs, int base, int nelems, int tostore)
#define check_condition(ls, c, msg)
TString * luaS_new(lua_State *L, const char *str)
static int cond(LexState *ls)
static void checkrepeated(LexState *ls, TString *name)
static void closelistfield(FuncState *fs, ConsControl *cc)
static int solvegotos(LexState *ls, Labeldesc *lb)
static void primaryexp(LexState *ls, expdesc *v)
static void localfunc(LexState *ls)
#define luaK_setmultret(fs, e)
struct expdesc::@7::@9 var
static void removevars(FuncState *fs, int tolevel)
static void init_exp(expdesc *e, expkind k, int i)
static l_noret undefgoto(LexState *ls, Labeldesc *gt)
static void checklimit(FuncState *fs, int v, int l, const char *what)
static int forprep(lua_State *L, StkId ra)
static void fixforjump(FuncState *fs, int pc, int dest, int back)
static void adjustlocalvars(LexState *ls, int nvars)
static void adjust_assign(LexState *ls, int nvars, int nexps, expdesc *e)
static void leaveblock(FuncState *fs)
void luaK_infix(FuncState *fs, BinOpr op, expdesc *v)
static int registerlocalvar(LexState *ls, FuncState *fs, TString *varname)
static void fornum(LexState *ls, TString *varname, int line)
void luaK_posfix(FuncState *fs, BinOpr opr, expdesc *e1, expdesc *e2, int line)
static void body(LexState *ls, expdesc *e, int ismethod, int line)
static void solvegoto(LexState *ls, int g, Labeldesc *label)
static int new_localvar(LexState *ls, TString *name)
#define LFIELDS_PER_FLUSH
static void fieldsel(LexState *ls, expdesc *v)
static void check_conflict(LexState *ls, struct LHS_assign *lh, expdesc *v)
static void statlist(LexState *ls)
static int testnext(LexState *ls, int c)
static void yindex(LexState *ls, expdesc *v)
static void singlevaraux(FuncState *fs, TString *n, expdesc *var, int base)
static l_noret errorlimit(FuncState *fs, int limit, const char *what)
static TString * str_checkname(LexState *ls)
static void breakstat(LexState *ls)
static int getlocalattribute(LexState *ls)
int luaK_code(FuncState *fs, Instruction i)
int luaK_jump(FuncState *fs)
void luaK_exp2anyregup(FuncState *fs, expdesc *e)
struct expdesc::@7::@8 ind
void luaK_patchtohere(FuncState *fs, int list)
static BinOpr getbinopr(int op)
l_noret luaX_syntaxerror(LexState *ls, const char *msg)
void luaK_int(FuncState *fs, int reg, lua_Integer i)
void luaK_storevar(FuncState *fs, expdesc *var, expdesc *ex)
static void codestring(expdesc *e, TString *s)
static void forstat(LexState *ls, int line)
static l_noret error_expected(LexState *ls, int token)
static Vardesc * getlocalvardesc(FuncState *fs, int vidx)
static int funcname(LexState *ls, expdesc *v)
#define setclLvalue2s(L, o, cl)
static void check(LexState *ls, int c)
struct ConsControl ConsControl
#define luaM_shrinkvector(L, v, size, fs, t)
static void constructor(LexState *ls, expdesc *t)
void luaD_inctop(lua_State *L)
static int newupvalue(FuncState *fs, TString *name, expdesc *v)
static int explist(LexState *ls, expdesc *v)
static void mainfunc(LexState *ls, FuncState *fs)
static void checktoclose(LexState *ls, int level)
static void recfield(LexState *ls, ConsControl *cc)
void luaK_ret(FuncState *fs, int first, int nret)
static UnOpr getunopr(int op)
void luaK_settablesize(FuncState *fs, int pc, int ra, int asize, int hsize)
static void labelstat(LexState *ls, TString *name, int line)
Table * luaH_new(lua_State *L)
static void gotostat(LexState *ls)
static void retstat(LexState *ls)
static void forlist(LexState *ls, TString *indexname)
struct BlockCnt * previous
static BinOpr subexpr(LexState *ls, expdesc *v, int limit)
static void parlist(LexState *ls)
void luaK_exp2val(FuncState *fs, expdesc *e)
static void whilestat(LexState *ls, int line)
void luaK_nil(FuncState *fs, int from, int n)
Proto * luaF_newproto(lua_State *L)
int luaK_getlabel(FuncState *fs)
static void ifstat(LexState *ls, int line)
const char * luaO_pushfstring(lua_State *L, const char *fmt,...)
#define luaM_growvector(L, v, nelems, size, t, limit, e)
static void open_func(LexState *ls, FuncState *fs, BlockCnt *bl)
static void block(LexState *ls)
void luaK_checkstack(FuncState *fs, int n)
static void movegotosout(FuncState *fs, BlockCnt *bl)
static Proto * addprototype(LexState *ls)
static void repeatstat(LexState *ls, int line)
void luaK_prefix(FuncState *fs, UnOpr op, expdesc *e, int line)
static Labeldesc * findlabel(LexState *ls, TString *name)
static void forbody(LexState *ls, int base, int line, int nvars, int isgen)
#define sethvalue2s(L, o, h)
void luaK_setoneret(FuncState *fs, expdesc *e)
int luaK_exp2const(FuncState *fs, const expdesc *e, TValue *v)
static void funcstat(LexState *ls, int line)
static void suffixedexp(LexState *ls, expdesc *v)
static int block_follow(LexState *ls, int withuntil)
int luaY_nvarstack(FuncState *fs)
static void field(LexState *ls, ConsControl *cc)
static void markupval(FuncState *fs, int level)
static void init_var(FuncState *fs, expdesc *e, int vidx)
static void codeclosure(LexState *ls, expdesc *v)
void luaK_indexed(FuncState *fs, expdesc *t, expdesc *k)
LClosure * luaF_newLclosure(lua_State *L, int nupvals)
static void check_match(LexState *ls, int what, int who, int where)
static void listfield(LexState *ls, ConsControl *cc)
void luaK_setreturns(FuncState *fs, expdesc *e, int nresults)
static void expr(LexState *ls, expdesc *v)
void luaK_finish(FuncState *fs)
void luaK_dischargevars(FuncState *fs, expdesc *e)
void luaK_concat(FuncState *fs, int *l1, int l2)
static int newlabelentry(LexState *ls, Labellist *l, TString *name, int line, int pc)
static int reglevel(FuncState *fs, int nvar)
static void checknext(LexState *ls, int c)
void luaK_goiftrue(FuncState *fs, expdesc *e)
static void lastlistfield(FuncState *fs, ConsControl *cc)
static void statement(LexState *ls)
l_noret luaK_semerror(LexState *ls, const char *msg)
static LocVar * localdebuginfo(FuncState *fs, int vidx)
static const struct @6 priority[]
#define luaK_codeABC(fs, o, a, b, c)
static int createlabel(LexState *ls, TString *name, int line, int last)
static int searchvar(FuncState *fs, TString *n, expdesc *var)
void luaK_reserveregs(FuncState *fs, int n)
int luaK_codeABx(FuncState *fs, OpCode o, int a, unsigned int bc)
void luaK_self(FuncState *fs, expdesc *e, expdesc *key)
static void funcargs(LexState *ls, expdesc *f, int line)
#define luaS_newliteral(L, s)
#define getinstruction(fs, e)
static void singlevar(LexState *ls, expdesc *var)
static void test_then_block(LexState *ls, int *escapelist)
int luaX_lookahead(LexState *ls)
void luaK_exp2nextreg(FuncState *fs, expdesc *e)
static int newgotoentry(LexState *ls, TString *name, int line, int pc)
struct Dyndata::@11 actvar
static void exprstat(LexState *ls)
plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:45