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)",
179 LocVar, SHRT_MAX,
"local variables");
180 while (oldsize < f->sizelocvars)
208#define new_localvarliteral(ls,v) \
210 luaX_newstring(ls, "" v, (sizeof(v)/sizeof(char)) - 1));
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++) {
358 while (oldsize < f->sizeupvalues)
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'";
520 if (l_unlikely(
gt->nactvar < label->
nactvar))
523 for (i = g; i < gl->
n - 1; i++)
524 gl->
arr[i] = gl->
arr[i + 1];
649 msg =
"break outside loop at line %d";
653 msg =
"no visible label '%s' for <goto> at line %d";
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");
1225static 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) {
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);
1945 lexstate.
buff = buff;
int luaK_jump(FuncState *fs)
void luaK_prefix(FuncState *fs, UnOpr op, expdesc *e)
void luaK_infix(FuncState *fs, BinOpr op, expdesc *v)
void luaK_exp2val(FuncState *fs, expdesc *e)
void luaK_exp2nextreg(FuncState *fs, expdesc *e)
static void luaK_goiffalse(FuncState *fs, expdesc *e)
void luaK_storevar(FuncState *fs, expdesc *var, expdesc *ex)
void luaK_self(FuncState *fs, expdesc *e, expdesc *key)
int luaK_codeABx(FuncState *fs, OpCode o, int a, unsigned int bc)
void luaK_patchlist(FuncState *fs, int list, int target)
void luaK_patchtohere(FuncState *fs, int list)
static int luaK_code(FuncState *fs, Instruction i, int line)
void luaK_nil(FuncState *fs, int from, int n)
void luaK_posfix(FuncState *fs, BinOpr op, expdesc *e1, expdesc *e2)
void luaK_goiftrue(FuncState *fs, expdesc *e)
void luaK_setoneret(FuncState *fs, expdesc *e)
void luaK_dischargevars(FuncState *fs, expdesc *e)
void luaK_concat(FuncState *fs, int *l1, int l2)
void luaK_setreturns(FuncState *fs, expdesc *e, int nresults)
void luaK_fixline(FuncState *fs, int line)
int luaK_exp2anyreg(FuncState *fs, expdesc *e)
void luaK_setlist(FuncState *fs, int base, int nelems, int tostore)
void luaK_ret(FuncState *fs, int first, int nret)
void luaK_reserveregs(FuncState *fs, int n)
void luaK_indexed(FuncState *fs, expdesc *t, expdesc *k)
int luaK_getlabel(FuncState *fs)
void luaK_checkstack(FuncState *fs, int n)
#define luaK_setmultret(fs, e)
Proto * luaF_newproto(lua_State *L)
Closure * luaF_newLclosure(lua_State *L, int nelems, Table *e)
#define luaC_objbarrier(L, p, o)
void luaX_syntaxerror(LexState *ls, const char *msg)
void luaX_next(LexState *ls)
void luaX_setinput(lua_State *L, LexState *ls, ZIO *z, TString *source)
const char * luaX_token2str(LexState *ls, int token)
void luaX_lookahead(LexState *ls)
#define luaM_growvector(L, v, nelems, size, t, limit, e)
const char * luaO_pushfstring(lua_State *L, const char *fmt,...)
#define LFIELDS_PER_FLUSH
#define luaS_newliteral(L, s)
Table * luaH_new(lua_State *L, int narray, int nhash)
void luaK_exp2anyregup(FuncState *fs, expdesc *e)
#define luaK_jumpto(fs, t)
#define getinstruction(fs, e)
void luaD_inctop(lua_State *L)
void luaK_int(FuncState *fs, int reg, lua_Integer i)
void luaK_settablesize(FuncState *fs, int pc, int ra, int asize, int hsize)
void luaK_finish(FuncState *fs)
l_noret luaK_semerror(LexState *ls, const char *msg)
int luaK_exp2const(FuncState *fs, const expdesc *e, TValue *v)
#define luaK_codeABC(fs, o, a, b, c)
#define luaM_shrinkvector(L, v, size, fs, t)
#define setclLvalue2s(L, o, cl)
static void checknext(LexState *ls, int c)
static void mainfunc(LexState *ls, FuncState *fs)
#define new_localvarliteral(ls, v)
int luaY_nvarstack(FuncState *fs)
static void codestring(expdesc *e, TString *s)
static l_noret undefgoto(LexState *ls, Labeldesc *gt)
static Vardesc * getlocalvardesc(FuncState *fs, int vidx)
static TString * str_checkname(LexState *ls)
static void removevars(FuncState *fs, int tolevel)
static void fornum(LexState *ls, TString *varname, int line)
static void labelstat(LexState *ls, TString *name, int line)
static void init_var(FuncState *fs, expdesc *e, int vidx)
static void block(LexState *ls)
static int cond(LexState *ls)
static void forbody(LexState *ls, int base, int line, int nvars, int isgen)
static int explist(LexState *ls, expdesc *v)
static l_noret error_expected(LexState *ls, int token)
static void checktoclose(LexState *ls, int level)
static void exprstat(LexState *ls)
static const struct @88 priority[]
static Upvaldesc * allocupvalue(FuncState *fs)
static int reglevel(FuncState *fs, int nvar)
static void singlevar(LexState *ls, expdesc *var)
static void field(LexState *ls, ConsControl *cc)
static void simpleexp(LexState *ls, expdesc *v)
static void codeclosure(LexState *ls, expdesc *v)
static void close_func(LexState *ls)
static BinOpr subexpr(LexState *ls, expdesc *v, int limit)
static void listfield(LexState *ls, ConsControl *cc)
static void singlevaraux(FuncState *fs, TString *n, expdesc *var, int base)
static void restassign(LexState *ls, struct LHS_assign *lh, int nvars)
static void adjustlocalvars(LexState *ls, int nvars)
static int searchupvalue(FuncState *fs, TString *name)
static void funcargs(LexState *ls, expdesc *f, int line)
static void test_then_block(LexState *ls, int *escapelist)
static void gotostat(LexState *ls)
static void movegotosout(FuncState *fs, BlockCnt *bl)
static int block_follow(LexState *ls, int withuntil)
static Labeldesc * findlabel(LexState *ls, TString *name)
static void forlist(LexState *ls, TString *indexname)
static l_noret jumpscopeerror(LexState *ls, Labeldesc *gt)
static void fixforjump(FuncState *fs, int pc, int dest, int back)
static void check_readonly(LexState *ls, expdesc *e)
static void setvararg(FuncState *fs, int nparams)
static int testnext(LexState *ls, int c)
static void solvegoto(LexState *ls, int g, Labeldesc *label)
static void fieldsel(LexState *ls, expdesc *v)
static BinOpr getbinopr(int op)
static void retstat(LexState *ls)
static void funcstat(LexState *ls, int line)
static void check_conflict(LexState *ls, struct LHS_assign *lh, expdesc *v)
static void codename(LexState *ls, expdesc *e)
static void adjust_assign(LexState *ls, int nvars, int nexps, expdesc *e)
static int newupvalue(FuncState *fs, TString *name, expdesc *v)
static void recfield(LexState *ls, ConsControl *cc)
static void repeatstat(LexState *ls, int line)
static int new_localvar(LexState *ls, TString *name)
static void localfunc(LexState *ls)
static Proto * addprototype(LexState *ls)
static int funcname(LexState *ls, expdesc *v)
static void leaveblock(FuncState *fs)
static int searchvar(FuncState *fs, TString *n, expdesc *var)
static void lastlistfield(FuncState *fs, ConsControl *cc)
static LocVar * localdebuginfo(FuncState *fs, int vidx)
static void body(LexState *ls, expdesc *e, int ismethod, int line)
static void init_exp(expdesc *e, expkind k, int i)
struct ConsControl ConsControl
static int getlocalattribute(LexState *ls)
static void checkrepeated(LexState *ls, TString *name)
static void closelistfield(FuncState *fs, ConsControl *cc)
static void markupval(FuncState *fs, int level)
static void primaryexp(LexState *ls, expdesc *v)
LClosure * luaY_parser(lua_State *L, ZIO *z, Mbuffer *buff, Dyndata *dyd, const char *name, int firstchar)
static void check_match(LexState *ls, int what, int who, int where)
static int solvegotos(LexState *ls, Labeldesc *lb)
static int createlabel(LexState *ls, TString *name, int line, int last)
static void statement(LexState *ls)
static void yindex(LexState *ls, expdesc *v)
static int newlabelentry(LexState *ls, Labellist *l, TString *name, int line, int pc)
static void open_func(LexState *ls, FuncState *fs, BlockCnt *bl)
static l_noret errorlimit(FuncState *fs, int limit, const char *what)
static void exp1(LexState *ls)
static void parlist(LexState *ls)
static void checklimit(FuncState *fs, int v, int l, const char *what)
static void suffixedexp(LexState *ls, expdesc *v)
static void breakstat(LexState *ls)
static int registerlocalvar(LexState *ls, FuncState *fs, TString *varname)
static void ifstat(LexState *ls, int line)
#define check_condition(ls, c, msg)
static void localstat(LexState *ls)
static void enterblock(FuncState *fs, BlockCnt *bl, lu_byte isloop)
static void whilestat(LexState *ls, int line)
static void expr(LexState *ls, expdesc *v)
static void forstat(LexState *ls, int line)
static int newgotoentry(LexState *ls, TString *name, int line, int pc)
static UnOpr getunopr(int op)
static void constructor(LexState *ls, expdesc *t)
static void statlist(LexState *ls)
static int forprep(lua_State *L, StkId ra)
CURL_EXTERN CURLMcode curl_socket_t s
struct BlockCnt * previous
struct Dyndata::@63 actvar
AbsLineInfo * abslineinfo
struct expdesc::@89::@91 var
struct expdesc::@61::@62 ind