Print proper error message if Lua expression parse fails

This commit is contained in:
Ilari Liusvaara 2013-11-26 08:23:16 +02:00
parent 5ccdb1be8c
commit 75a0f641f4

View file

@ -113,7 +113,8 @@ namespace
#define TEMPORARY "LUAINTERP_INTERNAL_COMMAND_TEMPORARY" #define TEMPORARY "LUAINTERP_INTERNAL_COMMAND_TEMPORARY"
const char* eval_lua_lua = "loadstring(" TEMPORARY ")();"; const char* eval_lua_lua = "local fn = loadstring(" TEMPORARY "); if fn then fn(); else print("
"\"Parse error in Lua statement\"); end;";
const char* run_lua_lua = "dofile(" TEMPORARY ");"; const char* run_lua_lua = "dofile(" TEMPORARY ");";
void run_lua_fragment(lua_state& L) throw(std::bad_alloc) void run_lua_fragment(lua_state& L) throw(std::bad_alloc)