|
|
@@ -708,29 +708,29 @@ void VM::_log_s_data(const char* title) {
|
|
|
void VM::init_builtin_types(){
|
|
|
_all_types.push_back({heap._new<Type>(Type(1), Type(0)), -1, nullptr, "object", true});
|
|
|
_all_types.push_back({heap._new<Type>(Type(1), Type(1)), 0, nullptr, "type", false});
|
|
|
- tp_object = 0; tp_type = 1;
|
|
|
-
|
|
|
- tp_int = _new_type_object("int");
|
|
|
- tp_float = _new_type_object("float");
|
|
|
- if(tp_int.index != kTpIntIndex || tp_float.index != kTpFloatIndex) FATAL_ERROR();
|
|
|
-
|
|
|
- tp_bool = _new_type_object("bool");
|
|
|
- tp_str = _new_type_object("str");
|
|
|
- tp_list = _new_type_object("list");
|
|
|
- tp_tuple = _new_type_object("tuple");
|
|
|
- tp_slice = _new_type_object("slice");
|
|
|
- tp_range = _new_type_object("range");
|
|
|
- tp_module = _new_type_object("module");
|
|
|
- tp_function = _new_type_object("function");
|
|
|
- tp_native_func = _new_type_object("native_func");
|
|
|
- tp_bound_method = _new_type_object("bound_method");
|
|
|
- tp_super = _new_type_object("super");
|
|
|
- tp_exception = _new_type_object("_Exception");
|
|
|
- tp_bytes = _new_type_object("bytes");
|
|
|
- tp_mappingproxy = _new_type_object("mappingproxy");
|
|
|
- tp_dict = _new_type_object("dict");
|
|
|
- tp_property = _new_type_object("property");
|
|
|
- tp_star_wrapper = _new_type_object("_star_wrapper");
|
|
|
+
|
|
|
+ PK_ASSERT(tp_int == _new_type_object("int"));
|
|
|
+ PK_ASSERT(tp_float == _new_type_object("float"));
|
|
|
+
|
|
|
+ PK_ASSERT(tp_bool == _new_type_object("bool"));
|
|
|
+ PK_ASSERT(tp_str == _new_type_object("str"));
|
|
|
+ PK_ASSERT(tp_list == _new_type_object("list"));
|
|
|
+ PK_ASSERT(tp_tuple == _new_type_object("tuple"));
|
|
|
+
|
|
|
+ PK_ASSERT(tp_slice == _new_type_object("slice"));
|
|
|
+ PK_ASSERT(tp_range == _new_type_object("range"));
|
|
|
+ PK_ASSERT(tp_module == _new_type_object("module"));
|
|
|
+ PK_ASSERT(tp_function == _new_type_object("function"));
|
|
|
+ PK_ASSERT(tp_native_func == _new_type_object("native_func"));
|
|
|
+ PK_ASSERT(tp_bound_method == _new_type_object("bound_method"));
|
|
|
+
|
|
|
+ PK_ASSERT(tp_super == _new_type_object("super"));
|
|
|
+ PK_ASSERT(tp_exception == _new_type_object("_Exception"));
|
|
|
+ PK_ASSERT(tp_bytes == _new_type_object("bytes"));
|
|
|
+ PK_ASSERT(tp_mappingproxy == _new_type_object("mappingproxy"));
|
|
|
+ PK_ASSERT(tp_dict == _new_type_object("dict"));
|
|
|
+ PK_ASSERT(tp_property == _new_type_object("property"));
|
|
|
+ PK_ASSERT(tp_star_wrapper == _new_type_object("_star_wrapper"));
|
|
|
|
|
|
this->None = heap._new<Dummy>(_new_type_object("NoneType"));
|
|
|
this->NotImplemented = heap._new<Dummy>(_new_type_object("NotImplementedType"));
|