| … | … | @@ -282,8 +282,24 @@ Handle Sexpr::decode_atom(const std::string& s, |
| 282 | 282 | l1 = l; |
| 283 | 283 | r1 = r; |
| 284 | 284 | const std::string name = get_node_name(s, l1, r1, atype, line_cnt); |
| 285 | l = r1 + 1; |
| 285 | 286 | |
| 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)); |
| 287 | 303 | asp->set_name(name); |
| 288 | 304 | Handle h(asp); |
| 289 | 305 | return h; |