@@ -75,8 +75,15 @@ static inline void *m_realloc_dyn(void *ptr, size_t new_num_bytes) {
75
75
#define MP_OBJ_NEW_QSTR (x ) MP_OBJ_NEW_QSTR_ ## x
76
76
77
77
#define mp_type_type (*mp_fun_table.type_type)
78
+ #define mp_type_NoneType (*mp_fun_table.type_NoneType)
79
+ #define mp_type_bool (*mp_fun_table.type_bool)
80
+ #define mp_type_int (*mp_fun_table.type_int)
78
81
#define mp_type_str (*mp_fun_table.type_str)
82
+ #define mp_type_bytes (*mp_fun_Table.type_bytes)
83
+ #define mp_type_float (*mp_fun_table.type_float)
84
+ #define mp_type_tuple (*mp_fun_table.type_tuple)
79
85
#define mp_type_list (*mp_fun_table.type_list)
86
+ #define mp_type_dict (*mp_fun_table.type_dict)
80
87
#define mp_type_EOFError (*(mp_obj_type_t*)(mp_load_global(MP_QSTR_EOFError)))
81
88
#define mp_type_IndexError (*(mp_obj_type_t*)(mp_load_global(MP_QSTR_IndexError)))
82
89
#define mp_type_KeyError (*(mp_obj_type_t*)(mp_load_global(MP_QSTR_KeyError)))
@@ -104,18 +111,22 @@ static inline void *m_realloc_dyn(void *ptr, size_t new_num_bytes) {
104
111
#define mp_obj_new_bytearray_by_ref (n , i ) (mp_fun_table.obj_new_bytearray_by_ref((n), (i)))
105
112
#define mp_obj_new_tuple (n , items ) (mp_fun_table.new_tuple((n), (items)))
106
113
#define mp_obj_new_list (n , items ) (mp_fun_table.new_list((n), (items)))
114
+ #define mp_obj_new_dict (n ) (mp_fun_table.new_dict((n)))
107
115
108
116
#define mp_obj_get_type (o ) (mp_fun_table.obj_get_type((o)))
109
117
#define mp_obj_get_int (o ) (mp_fun_table.native_from_obj(o, MP_NATIVE_TYPE_INT))
110
118
#define mp_obj_get_int_truncated (o ) (mp_fun_table.native_from_obj(o, MP_NATIVE_TYPE_UINT))
111
119
#define mp_obj_str_get_str (s ) ((void*)mp_fun_table.native_from_obj(s, MP_NATIVE_TYPE_PTR))
120
+ #define mp_obj_bytes_get_bytes (s ) ((void*)mp_fun_table.native_from_obj(s, MP_NATIVE_TYPE_PTR))
121
+
112
122
#define mp_obj_str_get_data (o , len ) (mp_obj_str_get_data_dyn((o), (len)))
113
123
#define mp_get_buffer_raise (o , bufinfo , fl ) (mp_fun_table.get_buffer_raise((o), (bufinfo), (fl)))
114
124
#define mp_get_stream_raise (s , flags ) (mp_fun_table.get_stream_raise((s), (flags)))
115
125
116
126
#define mp_obj_len (o ) (mp_obj_len_dyn(o))
117
127
#define mp_obj_subscr (base , index , val ) (mp_fun_table.obj_subscr((base), (index), (val)))
118
128
#define mp_obj_list_append (list , item ) (mp_fun_table.list_append((list), (item)))
129
+ #define mp_obj_dict_store (dict , key , val ) (mp_fun_table.dict_store(dict, key, val))
119
130
120
131
static inline mp_obj_t mp_obj_new_str_of_type_dyn (const mp_obj_type_t * type , const byte * data , size_t len ) {
121
132
if (type == & mp_type_str ) {
0 commit comments