🎨 improve report format of ghost type

This commit is contained in:
ValKmjolnir 2024-07-08 22:47:30 +08:00
parent 858ffdcb61
commit 4da38f686f
3 changed files with 3 additions and 10 deletions

View File

@ -168,9 +168,8 @@ void nas_ghost::clear() {
}
std::ostream& operator<<(std::ostream& out, const nas_ghost& ghost) {
out << "<object " << ghost.get_ghost_name();
out << " at 0x" << std::hex;
out << ghost.convert<u64>() << std::dec << ">";
out << "<" << ghost.get_ghost_name();
out << "@0x" << std::hex << ghost.convert<u64>() << std::dec << ">";
return out;
}

View File

@ -110,11 +110,6 @@ void vm::hash_value_info(var& val, const usize max_show_elems) {
std::clog << "}";
}
void vm::ghost_type_info(var& val) {
std::clog << "<object:" << val.ghost().type_name;
std::clog << "@0x" << std::hex << val.ghost().pointer << ">" << std::dec;
}
void vm::coroutine_value_info(var& val) {
std::clog << "[ ";
switch(val.co().status) {
@ -183,7 +178,7 @@ void vm::value_info(var& val) {
case vm_type::vm_upval: upvalue_info(val); break;
case vm_type::vm_vec: vector_value_info(val); break;
case vm_type::vm_hash: hash_value_info(val, 4); break;
case vm_type::vm_ghost: ghost_type_info(val); break;
case vm_type::vm_ghost: std::clog << val.ghost(); break;
case vm_type::vm_co: coroutine_value_info(val); break;
case vm_type::vm_map: namespace_value_info(val, 4); break;
default: std::clog << "unknown"; break;

View File

@ -71,7 +71,6 @@ protected:
void upvalue_info(var&);
void vector_value_info(var&);
void hash_value_info(var&, const usize);
void ghost_type_info(var&);
void coroutine_value_info(var&);
void namespace_value_info(var&, const usize);
void value_name_form(const var&);