MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mainfunc

Function mainfunc

freebsd/contrib/openzfs/module/lua/lparser.c:1609–1620  ·  view source on GitHub ↗

** compiles the main function, which is a regular vararg function with an ** upvalue named LUA_ENV */

Source from the content-addressed store, hash-verified

1607** upvalue named LUA_ENV
1608*/
1609static void mainfunc (LexState *ls, FuncState *fs) {
1610 BlockCnt bl;
1611 expdesc v;
1612 open_func(ls, fs, &bl);
1613 fs->f->is_vararg = 1; /* main function is always vararg */
1614 init_exp(&v, VLOCAL, 0); /* create and... */
1615 newupvalue(fs, ls->envn, &v); /* ...set environment upvalue */
1616 luaX_next(ls); /* read first token */
1617 statlist(ls); /* parse main body */
1618 check(ls, TK_EOS);
1619 close_func(ls);
1620}
1621
1622
1623Closure *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff,

Callers 1

luaY_parserFunction · 0.85

Calls 7

newupvalueFunction · 0.85
statlistFunction · 0.85
open_funcFunction · 0.70
init_expFunction · 0.70
luaX_nextFunction · 0.70
checkFunction · 0.70
close_funcFunction · 0.70

Tested by

no test coverage detected