lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> I have some large lua files.  I notice I could use lauxlib.h and call luaL_loadstring, but that looks like it will use about as much memory as the size of the lua file, which is undesirable.  I don't need the output, I only need to check that it's valid lua.

Use luaL_loadfile and check its return code. Pop the result from the stack
and the generated code will be collected eventually. But, no, there is no
way to parse a Lua script without generating code.