@@ -99,8 +99,8 @@ void mp_bytecode_print(const mp_print_t *print, const mp_raw_code_t *rc, size_t
9999 #else
100100 qstr source_file = cm -> source_file ;
101101 #endif
102- mp_printf (print , "File %s , code block '%s ' (descriptor: %p, bytecode @%p %u bytes)\n" ,
103- qstr_str ( source_file ), qstr_str ( block_name ) , rc , ip_start , (unsigned )fun_data_len );
102+ mp_printf (print , "File %q , code block '%q ' (descriptor: %p, bytecode @%p %u bytes)\n" ,
103+ source_file , block_name , rc , ip_start , (unsigned )fun_data_len );
104104
105105 // raw bytecode dump
106106 size_t prelude_size = ip - ip_start + n_info + n_cell ;
@@ -121,7 +121,7 @@ void mp_bytecode_print(const mp_print_t *print, const mp_raw_code_t *rc, size_t
121121 #if MICROPY_EMIT_BYTECODE_USES_QSTR_TABLE
122122 qst = cm -> qstr_table [qst ];
123123 #endif
124- mp_printf (print , " %s " , qstr_str ( qst ) );
124+ mp_printf (print , " %q " , qst );
125125 }
126126 mp_printf (print , "\n" );
127127
@@ -189,7 +189,7 @@ const byte *mp_bytecode_print_str(const mp_print_t *print, const byte *ip_start,
189189
190190 case MP_BC_LOAD_CONST_STRING :
191191 DECODE_QSTR ;
192- mp_printf (print , "LOAD_CONST_STRING '%s '" , qstr_str ( qst ) );
192+ mp_printf (print , "LOAD_CONST_STRING '%q '" , qst );
193193 break ;
194194
195195 case MP_BC_LOAD_CONST_OBJ :
@@ -214,27 +214,27 @@ const byte *mp_bytecode_print_str(const mp_print_t *print, const byte *ip_start,
214214
215215 case MP_BC_LOAD_NAME :
216216 DECODE_QSTR ;
217- mp_printf (print , "LOAD_NAME %s " , qstr_str ( qst ) );
217+ mp_printf (print , "LOAD_NAME %q " , qst );
218218 break ;
219219
220220 case MP_BC_LOAD_GLOBAL :
221221 DECODE_QSTR ;
222- mp_printf (print , "LOAD_GLOBAL %s " , qstr_str ( qst ) );
222+ mp_printf (print , "LOAD_GLOBAL %q " , qst );
223223 break ;
224224
225225 case MP_BC_LOAD_ATTR :
226226 DECODE_QSTR ;
227- mp_printf (print , "LOAD_ATTR %s " , qstr_str ( qst ) );
227+ mp_printf (print , "LOAD_ATTR %q " , qst );
228228 break ;
229229
230230 case MP_BC_LOAD_METHOD :
231231 DECODE_QSTR ;
232- mp_printf (print , "LOAD_METHOD %s " , qstr_str ( qst ) );
232+ mp_printf (print , "LOAD_METHOD %q " , qst );
233233 break ;
234234
235235 case MP_BC_LOAD_SUPER_METHOD :
236236 DECODE_QSTR ;
237- mp_printf (print , "LOAD_SUPER_METHOD %s " , qstr_str ( qst ) );
237+ mp_printf (print , "LOAD_SUPER_METHOD %q " , qst );
238238 break ;
239239
240240 case MP_BC_LOAD_BUILD_CLASS :
@@ -257,17 +257,17 @@ const byte *mp_bytecode_print_str(const mp_print_t *print, const byte *ip_start,
257257
258258 case MP_BC_STORE_NAME :
259259 DECODE_QSTR ;
260- mp_printf (print , "STORE_NAME %s " , qstr_str ( qst ) );
260+ mp_printf (print , "STORE_NAME %q " , qst );
261261 break ;
262262
263263 case MP_BC_STORE_GLOBAL :
264264 DECODE_QSTR ;
265- mp_printf (print , "STORE_GLOBAL %s " , qstr_str ( qst ) );
265+ mp_printf (print , "STORE_GLOBAL %q " , qst );
266266 break ;
267267
268268 case MP_BC_STORE_ATTR :
269269 DECODE_QSTR ;
270- mp_printf (print , "STORE_ATTR %s " , qstr_str ( qst ) );
270+ mp_printf (print , "STORE_ATTR %q " , qst );
271271 break ;
272272
273273 case MP_BC_STORE_SUBSCR :
@@ -286,12 +286,12 @@ const byte *mp_bytecode_print_str(const mp_print_t *print, const byte *ip_start,
286286
287287 case MP_BC_DELETE_NAME :
288288 DECODE_QSTR ;
289- mp_printf (print , "DELETE_NAME %s " , qstr_str ( qst ) );
289+ mp_printf (print , "DELETE_NAME %q " , qst );
290290 break ;
291291
292292 case MP_BC_DELETE_GLOBAL :
293293 DECODE_QSTR ;
294- mp_printf (print , "DELETE_GLOBAL %s " , qstr_str ( qst ) );
294+ mp_printf (print , "DELETE_GLOBAL %q " , qst );
295295 break ;
296296
297297 case MP_BC_DUP_TOP :
@@ -506,12 +506,12 @@ const byte *mp_bytecode_print_str(const mp_print_t *print, const byte *ip_start,
506506
507507 case MP_BC_IMPORT_NAME :
508508 DECODE_QSTR ;
509- mp_printf (print , "IMPORT_NAME '%s '" , qstr_str ( qst ) );
509+ mp_printf (print , "IMPORT_NAME '%q '" , qst );
510510 break ;
511511
512512 case MP_BC_IMPORT_FROM :
513513 DECODE_QSTR ;
514- mp_printf (print , "IMPORT_FROM '%s '" , qstr_str ( qst ) );
514+ mp_printf (print , "IMPORT_FROM '%q '" , qst );
515515 break ;
516516
517517 case MP_BC_IMPORT_STAR :
@@ -527,10 +527,10 @@ const byte *mp_bytecode_print_str(const mp_print_t *print, const byte *ip_start,
527527 mp_printf (print , "STORE_FAST " UINT_FMT , (mp_uint_t )ip [-1 ] - MP_BC_STORE_FAST_MULTI );
528528 } else if (ip [-1 ] < MP_BC_UNARY_OP_MULTI + MP_UNARY_OP_NUM_BYTECODE ) {
529529 mp_uint_t op = ip [-1 ] - MP_BC_UNARY_OP_MULTI ;
530- mp_printf (print , "UNARY_OP " UINT_FMT " %s " , op , qstr_str ( mp_unary_op_method_name [op ]) );
530+ mp_printf (print , "UNARY_OP " UINT_FMT " %q " , op , ( qstr ) mp_unary_op_method_name [op ]);
531531 } else if (ip [-1 ] < MP_BC_BINARY_OP_MULTI + MP_BINARY_OP_NUM_BYTECODE ) {
532532 mp_uint_t op = ip [-1 ] - MP_BC_BINARY_OP_MULTI ;
533- mp_printf (print , "BINARY_OP " UINT_FMT " %s " , op , qstr_str ( mp_binary_op_method_name [op ]) );
533+ mp_printf (print , "BINARY_OP " UINT_FMT " %q " , op , ( qstr ) mp_binary_op_method_name [op ]);
534534 } else {
535535 mp_printf (print , "code %p, byte code 0x%02x not implemented\n" , ip - 1 , ip [-1 ]);
536536 assert (0 );
0 commit comments