diff options
Diffstat (limited to 'src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp')
-rw-r--r-- | src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp b/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp index 67294da..717def9 100644 --- a/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp +++ b/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp @@ -73,18 +73,19 @@ static Data getLuaAsData(lua_State* _luaState, const luabridge::LuaRef& lua) { data.atom = toStr(lua.cast<int>()); data.type = Data::INTERPRETED; } else if(lua.isString()) { - data.atom = lua.tostring(); + data.atom = lua.cast<std::string>(); data.type = Data::VERBATIM; } else if(lua.isTable()) { bool isArray = false; bool isMap = false; for (luabridge::Iterator iter (lua); !iter.isNil(); ++iter) { - luabridge::LuaRef luaKey = iter.key(); + luabridge::LuaRef luaKey = iter.key(); luabridge::LuaRef luaVal = *iter; if (luaKey.isString()) { - assert(!isArray); + assert(!isArray); isMap = true; - data.compound[luaKey.tostring()] = getLuaAsData(_luaState, luaVal); + // luaKey.tostring() is not working?! see issue84 + data.compound[luaKey.cast<std::string>()] = getLuaAsData(_luaState, luaVal); } else { assert(!isMap); isArray = true; |