@@ -30,6 +30,14 @@ static void print_thing(const furvm::thing<>& thing) {
|
||||
}
|
||||
std::cout << " }";
|
||||
break;
|
||||
case thing_type::Slice:
|
||||
std::cout << "Slice [" << thing.length() << "] { ";
|
||||
for (thing_type::u64 i = 0; i < thing.length(); ++i) {
|
||||
if (i > 0) std::cout << ", ";
|
||||
print_thing(thing.at(i));
|
||||
}
|
||||
std::cout << " }";
|
||||
break;
|
||||
default: std::cerr << "{Type not recognized}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +54,9 @@ std::ostream& mod::serialize(std::ostream& os) const {
|
||||
detail::serialize(os, type.value.array.typeId);
|
||||
detail::serialize(os, type.value.array.size);
|
||||
} break;
|
||||
case mod_type::Slice: {
|
||||
detail::serialize(os, type.value.slice.typeId);
|
||||
} break;
|
||||
case mod_type::Import: {
|
||||
detail::serialize(os, type.value.imprt.modId);
|
||||
detail::serialize(os, type.value.imprt.typeId);
|
||||
@@ -169,6 +172,11 @@ mod mod::load(std::istream& is) {
|
||||
detail::load(is, size);
|
||||
mod.emplace_type(id, typeId, size).dispatch();
|
||||
} break;
|
||||
case mod_type::Slice: {
|
||||
mod_type_id typeId = 0;
|
||||
detail::load(is, typeId);
|
||||
mod.emplace_type(id, mod_type::Slice, typeId).dispatch();
|
||||
} break;
|
||||
case mod_type::Import: {
|
||||
std::string modName;
|
||||
detail::load(is, modName);
|
||||
|
||||
Reference in New Issue
Block a user