| 990 | |
| 991 | |
| 992 | static void f_parser (lua_State *L, void *ud) { |
| 993 | LClosure *cl; |
| 994 | struct SParser *p = cast(struct SParser *, ud); |
| 995 | int c = zgetc(p->z); /* read first character */ |
| 996 | if (c == LUA_SIGNATURE[0]) { |
| 997 | checkmode(L, p->mode, "binary"); |
| 998 | cl = luaU_undump(L, p->z, p->name); |
| 999 | } |
| 1000 | else { |
| 1001 | checkmode(L, p->mode, "text"); |
| 1002 | cl = luaY_parser(L, p->z, &p->buff, &p->dyd, p->name, c); |
| 1003 | } |
| 1004 | lua_assert(cl->nupvalues == cl->p->sizeupvalues); |
| 1005 | luaF_initupvals(L, cl); |
| 1006 | } |
| 1007 | |
| 1008 | |
| 1009 | int luaD_protectedparser (lua_State *L, ZIO *z, const char *name, |
nothing calls this directly
no test coverage detected