| 489 | }; |
| 490 | |
| 491 | static void f_parser (lua_State *L, void *ud) { |
| 492 | int i; |
| 493 | Proto *tf; |
| 494 | Closure *cl; |
| 495 | struct SParser *p = cast(struct SParser *, ud); |
| 496 | int c = luaZ_lookahead(p->z); |
| 497 | luaC_checkGC(L); |
| 498 | tf = ((c == LUA_SIGNATURE[0]) ? luaU_undump : luaY_parser)(L, p->z, |
| 499 | &p->buff, p->name); |
| 500 | cl = luaF_newLclosure(L, tf->nups, hvalue(gt(L))); |
| 501 | cl->l.p = tf; |
| 502 | for (i = 0; i < tf->nups; i++) /* initialize eventual upvalues */ |
| 503 | cl->l.upvals[i] = luaF_newupval(L); |
| 504 | setclvalue(L, L->top, cl); |
| 505 | incr_top(L); |
| 506 | } |
| 507 | |
| 508 | |
| 509 | int luaD_protectedparser (lua_State *L, ZIO *z, const char *name) { |
nothing calls this directly
no test coverage detected