/*1* The code below can be used to make a Lua core that does not contain the2* parsing modules (lcode, llex, lparser), which represent 35% of the total core.3* You'll only be able to load binary files and strings, precompiled with luac.4* (Of course, you'll have to build luac with the original parsing modules!)5*6* To use this module, simply compile it ("make noparser" does that) and list7* its object file before the Lua libraries. The linker should then not load8* the parsing modules. To try it, do "make luab".9*10* If you also want to avoid the dump module (ldump.o), define NODUMP.11* #define NODUMP12*/1314#define LUA_CORE1516#include "llex.h"17#include "lparser.h"18#include "lzio.h"1920LUAI_FUNC void luaX_init (lua_State *L) {21UNUSED(L);22}2324LUAI_FUNC Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, const char *name) {25UNUSED(z);26UNUSED(buff);27UNUSED(name);28lua_pushliteral(L,"parser not loaded");29lua_error(L);30return NULL;31}3233#ifdef NODUMP34#include "lundump.h"3536LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip) {37UNUSED(f);38UNUSED(w);39UNUSED(data);40UNUSED(strip);41#if 142UNUSED(L);43return 0;44#else45lua_pushliteral(L,"dumper not loaded");46lua_error(L);47#endif48}49#endif505152