MCPcopy Create free account
hub / github.com/DFHack/dfhack / luaD_protectedparser

Function luaD_protectedparser

depends/lua/src/ldo.c:783–800  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

781
782
783int luaD_protectedparser (lua_State *L, ZIO *z, const char *name,
784 const char *mode) {
785 struct SParser p;
786 int status;
787 L->nny++; /* cannot yield during parsing */
788 p.z = z; p.name = name; p.mode = mode;
789 p.dyd.actvar.arr = NULL; p.dyd.actvar.size = 0;
790 p.dyd.gt.arr = NULL; p.dyd.gt.size = 0;
791 p.dyd.label.arr = NULL; p.dyd.label.size = 0;
792 luaZ_initbuffer(L, &p.buff);
793 status = luaD_pcall(L, f_parser, &p, savestack(L, L->top), L->errfunc);
794 luaZ_freebuffer(L, &p.buff);
795 luaM_freearray(L, p.dyd.actvar.arr, p.dyd.actvar.size);
796 luaM_freearray(L, p.dyd.gt.arr, p.dyd.gt.size);
797 luaM_freearray(L, p.dyd.label.arr, p.dyd.label.size);
798 L->nny--;
799 return status;
800}
801
802

Callers 1

lua_loadFunction · 0.85

Calls 1

luaD_pcallFunction · 0.85

Tested by

no test coverage detected