diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-08-22 22:40:46 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-08-22 22:40:46 (GMT) |
commit | 10e6e1db531a682f852b488ba8bf4cbb2f984d88 (patch) | |
tree | 1f4b526103d1e6350a0ec09f40ae426344540dee /src/uscxml/plugins/datamodel | |
parent | 9509b795c7493d7b351dc25855a6a82cd392deb1 (diff) | |
download | uscxml-10e6e1db531a682f852b488ba8bf4cbb2f984d88.zip uscxml-10e6e1db531a682f852b488ba8bf4cbb2f984d88.tar.gz uscxml-10e6e1db531a682f852b488ba8bf4cbb2f984d88.tar.bz2 |
Spring cleaning of tests
Diffstat (limited to 'src/uscxml/plugins/datamodel')
-rw-r--r-- | src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp b/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp index 6fa56df..8eb1ce1 100644 --- a/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp +++ b/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp @@ -341,6 +341,16 @@ bool LuaDataModel::isLocation(const std::string& expr) { } bool LuaDataModel::isValidSyntax(const std::string& expr) { + int preStack = lua_gettop(_luaState); + int err = luaL_loadstring (_luaState, expr.c_str()); + + // clean stack again + lua_pop(_luaState, lua_gettop(_luaState) - preStack); + + + if (err == LUA_ERRSYNTAX) + return false; + return true; } |