| 784 | |
| 785 | |
| 786 | static void f_parser (lua_State *L, void *ud) { |
| 787 | LClosure *cl; |
| 788 | struct SParser *p = cast(struct SParser *, ud); |
| 789 | int c = zgetc(p->z); /* read first character */ |
| 790 | if (c == LUA_SIGNATURE[0]) { |
| 791 | checkmode(L, p->mode, "binary"); |
| 792 | cl = luaU_undump(L, p->z, p->name); |
| 793 | } |
| 794 | else { |
| 795 | checkmode(L, p->mode, "text"); |
| 796 | cl = luaY_parser(L, p->z, &p->buff, &p->dyd, p->name, c); |
| 797 | } |
| 798 | lua_assert(cl->nupvalues == cl->p->sizeupvalues); |
| 799 | luaF_initupvals(L, cl); |
| 800 | } |
| 801 | |
| 802 | |
| 803 | int luaD_protectedparser (lua_State *L, ZIO *z, const char *name, |
nothing calls this directly
no test coverage detected