diff options
author | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-12-10 06:56:07 -0800 |
---|---|---|
committer | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-12-10 06:56:07 -0800 |
commit | 3a054408336ab5754a9da6050bf31110f2211c89 (patch) | |
tree | b58d22733d2ee50a24942bb6e06786d7a84ea9ce /starts/meaning-vm/level-1/sugar.cpp | |
parent | 971852c322523145f44bf384bebb82870a99708d (diff) | |
parent | d84b81bc12e6a22e442d5dce38e59222119311f0 (diff) | |
download | standingwithresilience-3a054408336ab5754a9da6050bf31110f2211c89.tar.gz standingwithresilience-3a054408336ab5754a9da6050bf31110f2211c89.zip |
Merge branch 'wip'
Diffstat (limited to 'starts/meaning-vm/level-1/sugar.cpp')
-rw-r--r-- | starts/meaning-vm/level-1/sugar.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/starts/meaning-vm/level-1/sugar.cpp b/starts/meaning-vm/level-1/sugar.cpp index 24d59be..21f4001 100644 --- a/starts/meaning-vm/level-1/sugar.cpp +++ b/starts/meaning-vm/level-1/sugar.cpp @@ -49,15 +49,17 @@ ref movetoname(ref anonymous, ref name) // information is not available at this level. bool nonempty = false; for (auto & l : name.links()) { + if (l.first.linked(level0::concepts::allocator(), level0::concepts::level0allocations())) { continue; } if (l.first == concepts::name) { continue; } nonempty = true; } if (nonempty) { for (auto & link : anonymous.links()) { if (link.first == concepts::is && link.second == concepts::anonymous) { continue; } + if (link.first.linked(level0::concepts::allocator(), level0::concepts::level0allocations())) { continue; } if (link.first == concepts::name) { continue; } if (!name.linked(link.first, link.second)) { - throw std::logic_error(name.name() + " already defined otherwise from " + anonymous.get(concepts::is).name()); + throw std::logic_error(name.name() + " already defined otherwise from " + anonymous.getAll(concepts::is).begin()->name()); } } } @@ -66,12 +68,13 @@ ref movetoname(ref anonymous, ref name) anonymous.unlink(concepts::name, nam); if (!nonempty) { for (auto & l : anonymous.links()) { + if (l.first.linked(level0::concepts::allocator(), level0::concepts::level0allocations())) { continue; } name.link(l.first, l.second); } } anonymous.link(concepts::name, nam); - dealloc(anonymous); - dealloc(nam); + dealloc(anonymous, level0::concepts::allocations()); + //dealloc(nam, level0::concepts::allocations()); return name; } |