** compiles the main function, which is a regular vararg function with an ** upvalue named LUA_ENV */
| 1610 | ** upvalue named LUA_ENV |
| 1611 | */ |
| 1612 | static void mainfunc (LexState *ls, FuncState *fs) { |
| 1613 | BlockCnt bl; |
| 1614 | expdesc v; |
| 1615 | open_func(ls, fs, &bl); |
| 1616 | fs->f->is_vararg = 1; /* main function is always declared vararg */ |
| 1617 | init_exp(&v, VLOCAL, 0); /* create and... */ |
| 1618 | newupvalue(fs, ls->envn, &v); /* ...set environment upvalue */ |
| 1619 | luaX_next(ls); /* read first token */ |
| 1620 | statlist(ls); /* parse main body */ |
| 1621 | check(ls, TK_EOS); |
| 1622 | close_func(ls); |
| 1623 | } |
| 1624 | |
| 1625 | |
| 1626 | LClosure *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, |
no test coverage detected