| 713 | |
| 714 | |
| 715 | static void f_parser (lua_State *L, void *ud) { |
| 716 | int i; |
| 717 | Closure *cl; |
| 718 | struct SParser *p = cast(struct SParser *, ud); |
| 719 | int c = zgetc(p->z); /* read first character */ |
| 720 | lua_assert(c != LUA_SIGNATURE[0]); /* binary not supported */ |
| 721 | checkmode(L, p->mode, "text"); |
| 722 | cl = luaY_parser(L, p->z, &p->buff, &p->dyd, p->name, c); |
| 723 | lua_assert(cl->l.nupvalues == cl->l.p->sizeupvalues); |
| 724 | for (i = 0; i < cl->l.nupvalues; i++) { /* initialize upvalues */ |
| 725 | UpVal *up = luaF_newupval(L); |
| 726 | cl->l.upvals[i] = up; |
| 727 | luaC_objbarrier(L, cl, up); |
| 728 | } |
| 729 | } |
| 730 | |
| 731 | |
| 732 | int luaD_protectedparser (lua_State *L, ZIO *z, const char *name, |
nothing calls this directly
no test coverage detected