| 5634 | }; |
| 5635 | |
| 5636 | static void f_parser (lua_State *L, void *ud) { |
| 5637 | int i; |
| 5638 | Proto *tf; |
| 5639 | Closure *cl; |
| 5640 | struct SParser *p = cast(struct SParser *, ud); |
| 5641 | int c = luaZ_lookahead(p->z); |
| 5642 | luaC_checkGC(L); |
| 5643 | tf = ((c == LUA_SIGNATURE[0]) ? luaU_undump : luaY_parser)(L, p->z, |
| 5644 | &p->buff, p->name); |
| 5645 | cl = luaF_newLclosure(L, tf->nups, hvalue(gt(L))); |
| 5646 | cl->l.p = tf; |
| 5647 | for (i = 0; i < tf->nups; i++) /* initialize eventual upvalues */ |
| 5648 | cl->l.upvals[i] = luaF_newupval(L); |
| 5649 | setclvalue(L, L->top, cl); |
| 5650 | incr_top(L); |
| 5651 | } |
| 5652 | |
| 5653 | |
| 5654 | int luaD_protectedparser (lua_State *L, ZIO *z, const char *name) { |
nothing calls this directly
no test coverage detected