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

Function luaY_parser

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

Source from the content-addressed store, hash-verified

1621
1622
1623Closure *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff,
1624 Dyndata *dyd, const char *name, int firstchar) {
1625 LexState lexstate;
1626 FuncState funcstate;
1627 Closure *cl = luaF_newLclosure(L, 1); /* create main closure */
1628 /* anchor closure (to avoid being collected) */
1629 setclLvalue(L, L->top, cl);
1630 incr_top(L);
1631 funcstate.f = cl->l.p = luaF_newproto(L);
1632 funcstate.f->source = luaS_new(L, name); /* create and anchor TString */
1633 lexstate.buff = buff;
1634 lexstate.dyd = dyd;
1635 dyd->actvar.n = dyd->gt.n = dyd->label.n = 0;
1636 luaX_setinput(L, &lexstate, z, funcstate.f->source, firstchar);
1637 mainfunc(&lexstate, &funcstate);
1638 lua_assert(!funcstate.prev && funcstate.nups == 1 && !lexstate.fs);
1639 /* all scopes should be correctly finished */
1640 lua_assert(dyd->actvar.n == 0 && dyd->gt.n == 0 && dyd->label.n == 0);
1641 return cl; /* it's on the stack too */
1642}
1643/* END CSTYLED */

Callers 1

f_parserFunction · 0.70

Calls 5

luaS_newFunction · 0.85
mainfuncFunction · 0.85
luaF_newLclosureFunction · 0.70
luaF_newprotoFunction · 0.70
luaX_setinputFunction · 0.70

Tested by

no test coverage detected