summaryrefslogtreecommitdiffstats
path: root/src/uscxml/plugins
diff options
context:
space:
mode:
authorStefan Radomski <github@mintwerk.de>2017-05-14 11:42:18 (GMT)
committerStefan Radomski <github@mintwerk.de>2017-05-14 11:42:18 (GMT)
commit56074d3bd2ab4c8220b67b3da56ff55bbb286bae (patch)
treead507c0f39088bb367fe7bb295f9dba0396064d2 /src/uscxml/plugins
parent1453feb7ca59167c219afb21dfba4ed3ea68d176 (diff)
downloaduscxml-56074d3bd2ab4c8220b67b3da56ff55bbb286bae.zip
uscxml-56074d3bd2ab4c8220b67b3da56ff55bbb286bae.tar.gz
uscxml-56074d3bd2ab4c8220b67b3da56ff55bbb286bae.tar.bz2
Beautified code and some light refactoring
Diffstat (limited to 'src/uscxml/plugins')
-rw-r--r--src/uscxml/plugins/DataModelImpl.h11
-rw-r--r--src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp2
2 files changed, 8 insertions, 5 deletions
diff --git a/src/uscxml/plugins/DataModelImpl.h b/src/uscxml/plugins/DataModelImpl.h
index 62453a8..e3db75a 100644
--- a/src/uscxml/plugins/DataModelImpl.h
+++ b/src/uscxml/plugins/DataModelImpl.h
@@ -173,10 +173,13 @@ public:
virtual Data evalAsData(const std::string& content) = 0;
/**
- * evaluating script content without return
- * @param mostly used in script content.
- */
- virtual void eval(const std::string& content) { evalAsData(content); }
+ * Evaluating an expression
+ * We need an explicit 'eval' function for the LuaDataModel, see issue 118
+ * @param expr An expression in the data-model's language.
+ */
+ virtual void eval(const std::string& content) {
+ evalAsData(content);
+ }
/**
* Evaluate a given expression as a boolean.
diff --git a/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp b/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp
index 8f50729..9dcbc17 100644
--- a/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp
+++ b/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp
@@ -82,7 +82,7 @@ static Data getLuaAsData(lua_State* _luaState, const luabridge::LuaRef& lua) {
// we are creating __tmpFunc
// then it will be assigned to data variable
luabridge::setGlobal(_luaState, lua, "__tmpFunc");
-
+
data.atom = "__tmpFunc";
data.type = Data::INTERPRETED;
} else if(lua.isLightUserdata() || lua.isUserdata()) {