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