diff options
Diffstat (limited to 'src/uscxml')
-rw-r--r-- | src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp index 9bd8d9e..b32fecf 100644 --- a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp +++ b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp @@ -327,9 +327,11 @@ void SWIDataModel::setEvent(const Event& event) { void SWIDataModel::assertFromData(const Data& data, const std::string& expr, size_t nesting) { if (data.atom.size() > 0) { + // terminal branch, this is where we assert + std::stringstream ss; - ss << expr << "("; - nesting++; + ss << expr; +// nesting++; if (data.type == Data::VERBATIM) { ss << "\"" << data.atom << "\""; @@ -340,6 +342,8 @@ void SWIDataModel::assertFromData(const Data& data, const std::string& expr, siz for (size_t i = 0; i < nesting; i++) { ss << ")"; } + +// std::cout << ss.str() << std::endl; PlCall("assert", PlCompound(ss.str().c_str())); return; } @@ -347,7 +351,8 @@ void SWIDataModel::assertFromData(const Data& data, const std::string& expr, siz if (data.compound.size() > 0) { std::map<std::string, Data>::const_iterator compIter = data.compound.begin(); while(compIter != data.compound.end()) { - assertFromData(compIter->second, expr + "(" + compIter->first, nesting + 1); + assert(compIter->first.length() > 0); + assertFromData(compIter->second, expr + compIter->first + "(", nesting + 1); compIter++; } } |