OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-atomspace-storage commits / ecd88d6

Fix handling ov VoidValue
ecd88d673258e51f65cc0605400003affdf4d694
by Linas Vepstas <linasvepstas@gmail.com> · 2026-01-31T18:19:49.000Z

Changed files (1) +9 -1

opencog/persist/sexpr/ValueSexpr.cc +9 -1
……@@ -26,6 +26,7 @@
2626#include <opencog/atoms/value/FloatValue.h>
2727#include <opencog/atoms/value/LinkValue.h>
2828#include <opencog/atoms/value/StringValue.h>
29#include <opencog/atoms/value/VoidValue.h>
2930#include <opencog/atoms/value/ValueFactory.h>
3031#include <opencog/atomspace/AtomSpace.h>
3132
……@@ -105,7 +106,8 @@ ValuePtr Sexpr::decode_value(const std::string& stv, size_t& pos)
105106
106107 // What kind of value is it?
107108 // Increment pos by one to point just after the open-paren.
108 size_t vos = stv.find_first_of(" \n\t", ++pos);
109 // (VoidValue) will not have whitespace before the close-paren.
110 size_t vos = stv.find_first_of(" \n\t)", ++pos);
109111 if (std::string::npos == vos)
110112 throw SyntaxException(TRACE_INFO, "Badly formatted Value %s",
111113 stv.substr(pos).c_str());
……@@ -267,6 +269,12 @@ ValuePtr Sexpr::decode_value(const std::string& stv, size_t& pos)
267269 return valueserver().create(vtype, sv);
268270 }
269271
272 if (nameserver().isA(vtype, VOID_VALUE))
273 {
274 pos = vos + 1;
275 return createVoidValue();
276 }
277
270278 throw SyntaxException(TRACE_INFO, "Unsupported decode of Value %s",
271279 stv.substr(pos, vos-pos).c_str());
272280}