OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-atomspace-storage commits / 3dcaee0

Fix AtomSpace decode logic
The Child AtomSpaces were not being handled at all.
3dcaee0201fddefa8ee40dad2608f4e252b3f7d7
by Linas Vepštas <linasvepstas@gmail.com> · 2026-01-21T02:00:03.000Z

Changed files (1) +17 -1

opencog/persist/sexpr/AtomSexpr.cc +17 -1
……@@ -282,8 +282,24 @@ Handle Sexpr::decode_atom(const std::string& s,
282282 l1 = l;
283283 r1 = r;
284284 const std::string name = get_node_name(s, l1, r1, atype, line_cnt);
285 l = r1 + 1;
285286
286 AtomSpacePtr asp(createAtomSpace());
287 // A list of zero or more Atoms can follow the AtomSpace name.
288 // These are the parents. They must be passed to the ctor.
289 // Same string decode logic as handling Links, above.
290 HandleSeq outgoing;
291 do {
292 l1 = l;
293 r1 = r;
294 get_next_expr(s, l1, r1, line_cnt);
295 if (l1 == r1) break;
296
297 outgoing.push_back(decode_atom(s, l1, r1, line_cnt, ascache));
298
299 l = r1 + 1;
300 } while (l < r);
301
302 AtomSpacePtr asp(createAtomSpace(outgoing));
287303 asp->set_name(name);
288304 Handle h(asp);
289305 return h;