34 #define hasmultret(k) ((k) == VCALL || (k) == VVARARG)
86 const char *where = (line == 0)
121 #define check_condition(ls,c,msg) { if (!(c)) luaX_syntaxerror(ls, msg); }
131 "%s expected (to close %s at line %d)",
169 LocVar, SHRT_MAX,
"local variables");
170 while (oldsize < f->sizelocvars) f->
locvars[oldsize++].
varname = NULL;
193 #define new_localvarliteral(ls,v) \
194 new_localvarliteral_(ls, "" v, (sizeof(v)/sizeof(char))-1)
207 for (; nvars; nvars--) {
223 for (i = 0; i < fs->
nups; i++) {
236 while (oldsize < f->sizeupvalues) f->
upvalues[oldsize++].
name = NULL;
311 int extra = nvars - nexps;
314 if (extra < 0) extra = 0;
336 #define leavelevel(ls) ((ls)->L->nCcalls--)
348 "<goto %s> at line %d jumps into the scope of local " LUA_QS,
354 for (i = g; i < gl->
n - 1; i++)
355 gl->
arr[i] = gl->
arr[i + 1];
369 for (i = bl->
firstlabel; i < dyd->label.n; i++) {
464 ?
"<%s> at line %d not inside a loop"
465 :
"no visible label " LUA_QS " for <goto> at line %d";
503 int oldsize = f->
sizep;
505 while (oldsize < f->sizep) f->
p[oldsize++] = NULL;
744 if (ls->
t.
token ==
'}')
break;
858 nparams = fs->
freereg - (base+1);
964 "cannot use " LUA_QL(
"...")
" outside a vararg function");
1018 static const struct {
1022 {6, 6}, {6, 6}, {7, 7}, {7, 7}, {7, 7},
1024 {3, 3}, {3, 3}, {3, 3},
1025 {3, 3}, {3, 3}, {3, 3},
1029 #define UNARY_PRIORITY 8
1111 for (; lh; lh = lh->
prev) {
1117 lh->
v.
u.
ind.t = extra;
1122 lh->
v.
u.
ind.idx = extra;
1152 if (nexps != nvars) {
1199 "label " LUA_QS " already defined on line %d",
1240 condexit =
cond(ls);
1262 condexit =
cond(ls);
1326 forbody(ls, base, line, 1, 1);
1351 forbody(ls, base, line, nvars - 3, 0);
1364 case '=':
fornum(ls, varname, line);
break;
1457 while (ls->
t.
token ==
'.')
1459 if (ls->
t.
token ==
':') {
1473 body(ls, &b, ismethod, line);
1506 if (e.
k ==
VCALL && nret == 1) {
1627 lexstate.
buff = buff;
static void close_func(LexState *ls)
static void anchor_token(LexState *ls)
void luaK_prefix(FuncState *fs, UnOpr op, expdesc *e, int line)
static Proto * addprototype(LexState *ls)
void luaX_next(LexState *ls)
#define luaK_setmultret(fs, e)
static void constructor(LexState *ls, expdesc *t)
static void check(LexState *ls, int c)
static void localfunc(LexState *ls)
int luaK_codek(FuncState *fs, int reg, int k)
static void exprstat(LexState *ls)
static int exp1(LexState *ls)
static void whilestat(LexState *ls, int line)
static const struct @12 priority[]
int luaK_jump(FuncState *fs)
Closure * luaF_newLclosure(lua_State *L, int n)
static void forstat(LexState *ls, int line)
Proto * luaF_newproto(lua_State *L)
static void checkrepeated(FuncState *fs, Labellist *ll, TString *label)
static void mainfunc(LexState *ls, FuncState *fs)
static void skipnoopstat(LexState *ls)
#define luaK_codeAsBx(fs, o, A, sBx)
static void primaryexp(LexState *ls, expdesc *v)
static void body(LexState *ls, expdesc *e, int ismethod, int line)
static void singlevar(LexState *ls, expdesc *var)
LUAI_FUNC void luaK_patchclose(FuncState *fs, int list, int level)
static int searchupvalue(FuncState *fs, TString *name)
static void localstat(LexState *ls)
#define new_localvarliteral(ls, v)
static l_noret semerror(LexState *ls, const char *msg)
GLfloat GLfloat GLfloat v2
GLuint const GLfloat * val
static void codestring(LexState *ls, expdesc *e, TString *s)
int luaK_codeABx(FuncState *fs, OpCode o, int a, unsigned int bc)
static int registerlocalvar(LexState *ls, TString *varname)
void luaK_setoneret(FuncState *fs, expdesc *e)
static void retstat(LexState *ls)
const char * what() const
l_noret luaX_syntaxerror(LexState *ls, const char *msg)
static void listfield(LexState *ls, struct ConsControl *cc)
#define check_condition(ls, c, msg)
void luaK_self(FuncState *fs, expdesc *e, expdesc *key)
static void statlist(LexState *ls)
static void labelstat(LexState *ls, TString *label, int line)
TString * luaS_new(lua_State *L, const char *str)
void luaK_goiftrue(FuncState *fs, expdesc *e)
GLdouble GLdouble GLdouble b
void luaK_nil(FuncState *fs, int from, int n)
#define luaM_reallocvector(L, v, oldn, n, t)
void luaK_ret(FuncState *fs, int first, int nret)
static void suffixedexp(LexState *ls, expdesc *v)
static void adjust_assign(LexState *ls, int nvars, int nexps, expdesc *e)
static BinOpr getbinopr(int op)
TString * luaX_newstring(LexState *ls, const char *str, size_t l)
static LocVar * getlocvar(FuncState *fs, int i)
void luaK_exp2nextreg(FuncState *fs, expdesc *e)
static int findlabel(LexState *ls, int g)
static void init_exp(expdesc *e, expkind k, int i)
static void movegotosout(FuncState *fs, BlockCnt *bl)
void luaX_setinput(lua_State *L, LexState *ls, ZIO *z, TString *source, int firstchar)
static void findgotos(LexState *ls, Labeldesc *lb)
static void forlist(LexState *ls, TString *indexname)
static TString * str_checkname(LexState *ls)
void luaK_indexed(FuncState *fs, expdesc *t, expdesc *k)
static void field(LexState *ls, struct ConsControl *cc)
#define LFIELDS_PER_FLUSH
static void test_then_block(LexState *ls, int *escapelist)
static void closelistfield(FuncState *fs, struct ConsControl *cc)
static void enterblock(FuncState *fs, BlockCnt *bl, lu_byte isloop)
static void adjustlocalvars(LexState *ls, int nvars)
static void check_match(LexState *ls, int what, int who, int where)
static void checklimit(FuncState *fs, int v, int l, const char *what)
static void parlist(LexState *ls)
static void leaveblock(FuncState *fs)
void luaK_patchtohere(FuncState *fs, int list)
static void new_localvar(LexState *ls, TString *name)
void luaK_reserveregs(FuncState *fs, int n)
static int singlevaraux(FuncState *fs, TString *n, expdesc *var, int base)
const char * luaX_token2str(LexState *ls, int token)
static l_noret errorlimit(FuncState *fs, int limit, const char *what)
void luaK_checkstack(FuncState *fs, int n)
static int newupvalue(FuncState *fs, TString *name, expdesc *v)
void luaK_exp2anyregup(FuncState *fs, expdesc *e)
void luaK_setreturns(FuncState *fs, expdesc *e, int nresults)
static void fieldsel(LexState *ls, expdesc *v)
Table * luaH_new(lua_State *L)
int luaS_eqstr(TString *a, TString *b)
void luaK_posfix(FuncState *fs, BinOpr op, expdesc *e1, expdesc *e2, int line)
int luaO_int2fb(unsigned int x)
static void closegoto(LexState *ls, int g, Labeldesc *label)
static void funcstat(LexState *ls, int line)
static void block(LexState *ls)
static void removevars(FuncState *fs, int tolevel)
static void checknext(LexState *ls, int c)
static void open_func(LexState *ls, FuncState *fs, BlockCnt *bl)
struct Dyndata::@15 actvar
static void simpleexp(LexState *ls, expdesc *v)
static void new_localvarliteral_(LexState *ls, const char *name, size_t sz)
static void checkname(LexState *ls, expdesc *e)
static void funcargs(LexState *ls, expdesc *f, int line)
int luaK_exp2RK(FuncState *fs, expdesc *e)
Closure * luaY_parser(lua_State *L, ZIO *z, Mbuffer *buff, Dyndata *dyd, const char *name, int firstchar)
static void expr(LexState *ls, expdesc *v)
static void gotostat(LexState *ls, int pc)
static void enterlevel(LexState *ls)
int luaK_getlabel(FuncState *fs)
#define setclLvalue(L, obj, x)
static void statement(LexState *ls)
static UnOpr getunopr(int op)
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
static void forbody(LexState *ls, int base, int line, int nvars, int isnum)
void luaK_goiffalse(FuncState *fs, expdesc *e)
static int testnext(LexState *ls, int c)
static int funcname(LexState *ls, expdesc *v)
struct expdesc::@13::@14 ind
static void markupval(FuncState *fs, int level)
const char * luaO_pushfstring(lua_State *L, const char *fmt,...)
static void repeatstat(LexState *ls, int line)
#define luaK_jumpto(fs, t)
GLuint const GLchar * name
int luaX_lookahead(LexState *ls)
int luaK_exp2anyreg(FuncState *fs, expdesc *e)
static void codeclosure(LexState *ls, expdesc *v)
static l_noret undefgoto(LexState *ls, Labeldesc *gt)
void luaK_storevar(FuncState *fs, expdesc *var, expdesc *ex)
static void breaklabel(LexState *ls)
static void assignment(LexState *ls, struct LHS_assign *lh, int nvars)
static int cond(LexState *ls)
struct BlockCnt * previous
void luaK_infix(FuncState *fs, BinOpr op, expdesc *v)
int luaK_numberK(FuncState *fs, lua_Number r)
static int block_follow(LexState *ls, int withuntil)
void luaK_patchlist(FuncState *fs, int list, int target)
static l_noret error_expected(LexState *ls, int token)
static int newlabelentry(LexState *ls, Labellist *l, TString *name, int line, int pc)
void luaK_dischargevars(FuncState *fs, expdesc *e)
int luaK_codeABC(FuncState *fs, OpCode o, int a, int b, int c)
static void recfield(LexState *ls, struct ConsControl *cc)
static BinOpr subexpr(LexState *ls, expdesc *v, int limit)
#define luaC_objbarrier(L, p, o)
void luaK_fixline(FuncState *fs, int line)
#define luaM_growvector(L, v, nelems, size, t, limit, e)
static void check_conflict(LexState *ls, struct LHS_assign *lh, expdesc *v)
void luaK_concat(FuncState *fs, int *l1, int l2)
static void yindex(LexState *ls, expdesc *v)
void luaK_exp2val(FuncState *fs, expdesc *e)
static int searchvar(FuncState *fs, TString *n)
static void ifstat(LexState *ls, int line)
static int explist(LexState *ls, expdesc *v)
int luaK_stringK(FuncState *fs, TString *s)
static void lastlistfield(FuncState *fs, struct ConsControl *cc)
void luaK_setlist(FuncState *fs, int base, int nelems, int tostore)
static void fornum(LexState *ls, TString *varname, int line)