| … | … | @@ -26,6 +26,7 @@ |
| 26 | 26 | #include <opencog/atoms/value/FloatValue.h> |
| 27 | 27 | #include <opencog/atoms/value/LinkValue.h> |
| 28 | 28 | #include <opencog/atoms/value/StringValue.h> |
| 29 | #include <opencog/atoms/value/VoidValue.h> |
| 29 | 30 | #include <opencog/atoms/value/ValueFactory.h> |
| 30 | 31 | #include <opencog/atomspace/AtomSpace.h> |
| 31 | 32 | |
| … | … | @@ -105,7 +106,8 @@ ValuePtr Sexpr::decode_value(const std::string& stv, size_t& pos) |
| 105 | 106 | |
| 106 | 107 | // What kind of value is it? |
| 107 | 108 | // 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); |
| 109 | 111 | if (std::string::npos == vos) |
| 110 | 112 | throw SyntaxException(TRACE_INFO, "Badly formatted Value %s", |
| 111 | 113 | stv.substr(pos).c_str()); |
| … | … | @@ -267,6 +269,12 @@ ValuePtr Sexpr::decode_value(const std::string& stv, size_t& pos) |
| 267 | 269 | return valueserver().create(vtype, sv); |
| 268 | 270 | } |
| 269 | 271 | |
| 272 | if (nameserver().isA(vtype, VOID_VALUE)) |
| 273 | { |
| 274 | pos = vos + 1; |
| 275 | return createVoidValue(); |
| 276 | } |
| 277 | |
| 270 | 278 | throw SyntaxException(TRACE_INFO, "Unsupported decode of Value %s", |
| 271 | 279 | stv.substr(pos, vos-pos).c_str()); |
| 272 | 280 | } |