| 925 | |
| 926 | |
| 927 | static void f_parser (lua_State *L, void *ud) { |
| 928 | LClosure *cl; |
| 929 | struct SParser *p = cast(struct SParser *, ud); |
| 930 | int c = zgetc(p->z); /* read first character */ |
| 931 | if (c == LUA_SIGNATURE[0]) { |
| 932 | checkmode(L, p->mode, "binary"); |
| 933 | cl = luaU_undump(L, p->z, p->name); |
| 934 | } |
| 935 | else { |
| 936 | checkmode(L, p->mode, "text"); |
| 937 | cl = luaY_parser(L, p->z, &p->buff, &p->dyd, p->name, c); |
| 938 | } |
| 939 | lua_assert(cl->nupvalues == cl->p->sizeupvalues); |
| 940 | luaF_initupvals(L, cl); |
| 941 | } |
| 942 | |
| 943 | |
| 944 | int luaD_protectedparser (lua_State *L, ZIO *z, const char *name, |
nothing calls this directly
no test coverage detected