summaryrefslogtreecommitdiff
path: root/starts/meaning-vm/level-1
diff options
context:
space:
mode:
Diffstat (limited to 'starts/meaning-vm/level-1')
-rw-r--r--starts/meaning-vm/level-1/ref.cpp2
-rw-r--r--starts/meaning-vm/level-1/ref.hpp13
-rw-r--r--starts/meaning-vm/level-1/sugar.hpp2
3 files changed, 8 insertions, 9 deletions
diff --git a/starts/meaning-vm/level-1/ref.cpp b/starts/meaning-vm/level-1/ref.cpp
index 045e879..b593f81 100644
--- a/starts/meaning-vm/level-1/ref.cpp
+++ b/starts/meaning-vm/level-1/ref.cpp
@@ -45,7 +45,7 @@ level0::ref getnamed(std::string const & name)
}
ref::ref(std::string const & name)
-: ref0((level0::concept*)getnamed(name))
+: baseref(getnamed(name).ptr())
{ }
vref<std::string> ref::name() const
diff --git a/starts/meaning-vm/level-1/ref.hpp b/starts/meaning-vm/level-1/ref.hpp
index 40eee20..8a7394e 100644
--- a/starts/meaning-vm/level-1/ref.hpp
+++ b/starts/meaning-vm/level-1/ref.hpp
@@ -1,15 +1,17 @@
#pragma once
#include "common.hpp"
+#include "../level-0/baseref.hpp"
#include "../level-0/ref.hpp"
-#include "../level-0/ref-mixin.hpp"
namespace intellect {
namespace level1 {
-struct ref : public level0::refmixin<ref,vref>
+struct ref : public level0::baseref<ref,vref,level0::concept>
{
- ref(level0::ref const & other) : ref0(other) { }
+ using level0::baseref<ref,vref,level0::concept>::baseref;
+ ref(level0::concept * p) : baseref(p) { }
+ ref(level0::ref const & other) : baseref(other.ptr()) { }
ref(std::string const & name);
ref(const char *name) : ref(std::string(name)) { }
ref(bool b) : ref(b ? "true" : "false") { }
@@ -20,14 +22,11 @@ struct ref : public level0::refmixin<ref,vref>
vref<std::string> name() const;
- level0::ref & l0() { return ref0; }
+ level0::ref & l0() { return *reinterpret_cast<level0::ref*>(this); }
ref & l1() { return self; }
ref const & l1() const { return self; }
std::string dump(ref skipmarkertype, ref skipmarkertarget);
-private:
-
- level0::ref ref0;
};
}
diff --git a/starts/meaning-vm/level-1/sugar.hpp b/starts/meaning-vm/level-1/sugar.hpp
index c2fa4f9..9d439e5 100644
--- a/starts/meaning-vm/level-1/sugar.hpp
+++ b/starts/meaning-vm/level-1/sugar.hpp
@@ -27,7 +27,7 @@ namespace internal {
if (name[name.size() - 1] == ',') {
name = name.substr(0, name.size() - 1);
}
- refptrs[i]->l0() = ref(name).l0();
+ refptrs[i]->ptr() = ref(name).ptr();
}
}
}