Imported from ../lua-5.0.2.tar.gz.
[lua.git] / etc / noparser.c
blob00c2b12625e159dbf1fa5e3f5fa8cb972cbd562f
1 /*
2 * The code below can be used to make a Lua core that does not contain the
3 * parsing modules (lcode, llex, lparser), which represent 35% of the total core.
4 * You'll only be able to load binary files and strings, precompiled with luac.
5 * (Of course, you'll have to build luac with the original parsing modules!)
7 * To use this module, simply compile it ("make noparser" does that) and
8 * list its object file before the Lua libraries. The linker should then not
9 * load the parsing modules. To try it, do "make luab".
12 #include "llex.h"
13 #include "lparser.h"
14 #include "lzio.h"
16 void luaX_init (lua_State *L) {
17 UNUSED(L);
20 Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff) {
21 UNUSED(z);
22 UNUSED(buff);
23 lua_pushstring(L,"parser not loaded");
24 lua_error(L);
25 return NULL;