From 5414c74f7c85c90fcbd7efc385248e873d7753dc Mon Sep 17 00:00:00 2001 From: olpc user Date: Tue, 31 Dec 2019 11:27:44 -0800 Subject: working on runtime errors --- starts/meaning-vm/level-1/baseref.hpp | 2 +- starts/meaning-vm/level-1/funcs.cpp | 17 +++++++---------- starts/meaning-vm/level-1/funcs.hpp | 2 +- 3 files changed, 9 insertions(+), 12 deletions(-) (limited to 'starts/meaning-vm/level-1') diff --git a/starts/meaning-vm/level-1/baseref.hpp b/starts/meaning-vm/level-1/baseref.hpp index 93e18ae..ac6ff9c 100644 --- a/starts/meaning-vm/level-1/baseref.hpp +++ b/starts/meaning-vm/level-1/baseref.hpp @@ -48,7 +48,7 @@ struct baseref : public level0::baseref template ref operator()(Ref... args) { return self.template fun()(args...); } - std::string dump(ref skipmarkertype, ref skipmarkertarget) { return level1::dump(self, skipmarkertype, skipmarkertarget); }; + std::string dump(ref set) { return level1::dump(self, set); }; private: template diff --git a/starts/meaning-vm/level-1/funcs.cpp b/starts/meaning-vm/level-1/funcs.cpp index 2ba2d0f..af4815b 100644 --- a/starts/meaning-vm/level-1/funcs.cpp +++ b/starts/meaning-vm/level-1/funcs.cpp @@ -150,10 +150,10 @@ concept* hyphenate(concept* a, concept* b) return getnamed(getname(a) + "-" + getname(b)); } -std::string dump(concept* what, concept* skipmarkertype, concept* skipmarkertarget) +std::string dump(concept* what, concept* set) { std::stringstream ss; - if (what->linked(skipmarkertype, skipmarkertarget)) { + if (set->linked(what, _true)) { return {}; } for (auto & link : ref(what).links()) { @@ -162,17 +162,14 @@ std::string dump(concept* what, concept* skipmarkertype, concept* skipmarkertarg if (ss.str().size() == 0) { ss << ref(what).name() << " " << (void*) what << ":\n"; } - ss << " " << link.first.name() << ": " << link.second.name() << "\n"; + ss << " " << link.first.name() << ": " << link.second.name() << " " << (void*)link.second << "\n"; } - what->link(skipmarkertype, skipmarkertarget); + set->link(what, _true); for (auto & link : ref(what).links()) { - if (link.first.linked(allocator, level0-allocations)) { continue; } - if (link.second.linked(allocator, level1-allocations)) { continue; } - if (link.first.ptr() == skipmarkertype && link.second.ptr() == skipmarkertarget) { - continue; - } + if (link.first.linked(level0::concepts::allocator(), level0::concepts::level0allocations())) { continue; } + if (link.second.linked(level0::concepts::allocator(), level1-allocations)) { continue; } if (link.second.isa(concepts::name)) { continue; } - ss << dump(link.second, skipmarkertype, skipmarkertarget); + ss << dump(link.second, set); } return ss.str(); } diff --git a/starts/meaning-vm/level-1/funcs.hpp b/starts/meaning-vm/level-1/funcs.hpp index d70a868..185de7b 100644 --- a/starts/meaning-vm/level-1/funcs.hpp +++ b/starts/meaning-vm/level-1/funcs.hpp @@ -21,7 +21,7 @@ concept* hyphenate(concept* a, concept* b); concept* alloc(concept* allocator, std::any val); -std::string dump(concept * what, concept * skipmarkertype, concept * skipmarkertarget); +std::string dump(concept * what, concept * set); } } -- cgit v1.2.3