diff options
Diffstat (limited to 'src/uscxml/plugins/datamodel/lua')
-rw-r--r-- | src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp | 24 | ||||
-rw-r--r-- | src/uscxml/plugins/datamodel/lua/LuaDataModel.h | 10 |
2 files changed, 13 insertions, 21 deletions
diff --git a/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp b/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp index 2ad89b5..ad35f80 100644 --- a/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp +++ b/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp @@ -349,9 +349,12 @@ Data LuaDataModel::evalAsData(const std::string& content) { throw originalError; // we will assume syntax error and throw } - if (retVals == 0) +#if 1 + // Note: Empty result is not an error test302, but how to do test488? + if (retVals == 0 && !isValidSyntax(trimmedExpr)) { throw originalError; // we will assume syntax error and throw - + } +#endif try { if (retVals == 1) { @@ -446,7 +449,7 @@ bool LuaDataModel::isDeclared(const std::string& expr) { } -void LuaDataModel::assign(const std::string& location, const Data& data) { +void LuaDataModel::assign(const std::string& location, const Data& data, const std::map<std::string, std::string>& attr) { if (location.length() == 0) { ERROR_EXECUTION_THROW("Assign element has neither id nor location"); } @@ -539,7 +542,7 @@ void LuaDataModel::assign(const std::string& location, const Data& data) { } } -void LuaDataModel::init(const std::string& location, const Data& data) { +void LuaDataModel::init(const std::string& location, const Data& data, const std::map<std::string, std::string>& attr) { luabridge::setGlobal(_luaState, luabridge::Nil(), location.c_str()); assign(location, data); } @@ -582,17 +585,4 @@ Data LuaDataModel::getAsData(const std::string& content) { return data; } - -std::string LuaDataModel::andExpressions(std::list<std::string> exprs) { - std::stringstream exprSS; - std::list<std::string>::const_iterator listIter; - std::string andExpr; - for (listIter = exprs.begin(); listIter != exprs.end(); listIter++) { - exprSS << andExpr << *listIter; - andExpr = " && "; - } - return exprSS.str(); -} - - } diff --git a/src/uscxml/plugins/datamodel/lua/LuaDataModel.h b/src/uscxml/plugins/datamodel/lua/LuaDataModel.h index 7b7121f..85d7b53 100644 --- a/src/uscxml/plugins/datamodel/lua/LuaDataModel.h +++ b/src/uscxml/plugins/datamodel/lua/LuaDataModel.h @@ -77,10 +77,12 @@ public: virtual bool isDeclared(const std::string& expr); - virtual void assign(const std::string& location, const Data& data); - virtual void init(const std::string& location, const Data& data); - - virtual std::string andExpressions(std::list<std::string>); + virtual void assign(const std::string& location, + const Data& data, + const std::map<std::string, std::string>& attr = std::map<std::string, std::string>()); + virtual void init(const std::string& location, + const Data& data, + const std::map<std::string, std::string>& attr = std::map<std::string, std::string>()); protected: |