Just read through the code few times because there are some silly things in it, like that:
bool
Value::loadFromString(const std::string& source)
{
LuaState L;
if (luaL_dofile(L, source.c_str()) == 1)//<<-- that should be dostring, not dofile..
{
return false;
}
lua_pushglobaltable(L);
fillTable(L, -1, *this);
return true;
}
bool
Value::loadFromFile(const std::string& file)
{
LuaState L;
if (luaL_dofile(L, file.c_str()) == 1)
{
return false;
}
lua_pushglobaltable(L);
fillTable(L, -1, *this);
return true;
}