MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaY_parser

Function luaY_parser

third-party/lua-5.2.4/src/lparser.c:1618–1637  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

f_parserFunction · 0.70

Calls 5

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

Tested by

no test coverage detected