Add features for gkernel 2 (#89)

* in progress

* format
This commit is contained in:
water111
2020-10-17 11:18:58 -04:00
committed by GitHub
parent d5d0d7f924
commit 3e798cd3aa
7 changed files with 217 additions and 18 deletions
+12 -3
View File
@@ -247,7 +247,6 @@ Type* TypeSystem::lookup_type(const std::string& name) const {
} else {
fmt::print("[TypeSystem] The type {} is not defined.\n", name);
}
throw std::runtime_error("lookup_type failed");
}
@@ -719,8 +718,14 @@ void TypeSystem::add_builtin_types() {
add_field_to_type(pair_type, "car", make_typespec("object"));
add_field_to_type(pair_type, "cdr", make_typespec("object"));
// todo, with kernel
(void)connectable_type;
// this type is very strange, as the compiler knows about it in gkernel-h, yet it is
// defined inside of connect.
add_field_to_type(connectable_type, "next0", make_typespec("connectable"));
add_field_to_type(connectable_type, "prev0", make_typespec("connectable"));
add_field_to_type(connectable_type, "next1", make_typespec("connectable"));
add_field_to_type(connectable_type, "prev1", make_typespec("connectable"));
// todo
(void)file_stream_type;
}
@@ -1010,6 +1015,10 @@ std::string TypeSystem::lca_base(const std::string& a, const std::string& b) {
return a;
}
if (a == "none" || b == "none") {
return "none";
}
auto a_up = get_path_up_tree(a);
auto b_up = get_path_up_tree(b);