| 354 | |
| 355 | |
| 356 | static void close_func (LexState *ls) { |
| 357 | lua_State *L = ls->L; |
| 358 | FuncState *fs = ls->fs; |
| 359 | Proto *f = fs->f; |
| 360 | removevars(ls, 0); |
| 361 | luaK_ret(fs, 0, 0); /* final return */ |
| 362 | luaM_reallocvector(L, f->code, f->sizecode, fs->pc, Instruction); |
| 363 | f->sizecode = fs->pc; |
| 364 | luaM_reallocvector(L, f->lineinfo, f->sizelineinfo, fs->pc, int); |
| 365 | f->sizelineinfo = fs->pc; |
| 366 | luaM_reallocvector(L, f->k, f->sizek, fs->nk, TValue); |
| 367 | f->sizek = fs->nk; |
| 368 | luaM_reallocvector(L, f->p, f->sizep, fs->np, Proto *); |
| 369 | f->sizep = fs->np; |
| 370 | luaM_reallocvector(L, f->locvars, f->sizelocvars, fs->nlocvars, LocVar); |
| 371 | f->sizelocvars = fs->nlocvars; |
| 372 | luaM_reallocvector(L, f->upvalues, f->sizeupvalues, f->nups, TString *); |
| 373 | f->sizeupvalues = f->nups; |
| 374 | lua_assert(luaG_checkcode(f)); |
| 375 | lua_assert(fs->bl == NULL); |
| 376 | ls->fs = fs->prev; |
| 377 | /* last token read was anchored in defunct function; must reanchor it */ |
| 378 | if (fs) anchor_token(ls); |
| 379 | L->top -= 2; /* remove table and prototype from the stack */ |
| 380 | } |
| 381 | |
| 382 | |
| 383 | Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, const char *name) { |
no test coverage detected