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