** compiles the main function, which is a regular vararg function with an ** upvalue named LUA_ENV */
| 1679 | ** upvalue named LUA_ENV |
| 1680 | */ |
| 1681 | static void mainfunc(LexState *ls, FuncState *fs) { |
| 1682 | BlockCnt bl; |
| 1683 | expdesc v; |
| 1684 | open_func(ls, fs, &bl); |
| 1685 | fs->f->is_vararg = 2; /* main function is always declared vararg */ |
| 1686 | init_exp(&v, VLOCAL, 0); /* create and... */ |
| 1687 | newupvalue(fs, ls->envn, &v); /* ...set environment upvalue */ |
| 1688 | luaX_next(ls); /* read first token */ |
| 1689 | statlist(ls); /* parse main body */ |
| 1690 | if (ls->L->force_stopping) |
| 1691 | return; |
| 1692 | check(ls, TK_EOS); |
| 1693 | close_func(ls); |
| 1694 | } |
| 1695 | |
| 1696 | |
| 1697 | LClosure *luaY_parser(lua_State *L, ZIO *z, Mbuffer *buff, |
no test coverage detected