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

Function f_parser

third-party/lua-5.2.4/src/ldo.c:640–659  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

638
639
640static void f_parser (lua_State *L, void *ud) {
641 int i;
642 Closure *cl;
643 struct SParser *p = cast(struct SParser *, ud);
644 int c = zgetc(p->z); /* read first character */
645 if (c == LUA_SIGNATURE[0]) {
646 checkmode(L, p->mode, "binary");
647 cl = luaU_undump(L, p->z, &p->buff, p->name);
648 }
649 else {
650 checkmode(L, p->mode, "text");
651 cl = luaY_parser(L, p->z, &p->buff, &p->dyd, p->name, c);
652 }
653 lua_assert(cl->l.nupvalues == cl->l.p->sizeupvalues);
654 for (i = 0; i < cl->l.nupvalues; i++) { /* initialize upvalues */
655 UpVal *up = luaF_newupval(L);
656 cl->l.upvals[i] = up;
657 luaC_objbarrier(L, cl, up);
658 }
659}
660
661
662int luaD_protectedparser (lua_State *L, ZIO *z, const char *name,

Callers

nothing calls this directly

Calls 4

checkmodeFunction · 0.70
luaU_undumpFunction · 0.70
luaY_parserFunction · 0.70
luaF_newupvalFunction · 0.70

Tested by

no test coverage detected