diff options
| -rw-r--r-- | py/parse.c | 6 | ||||
| -rw-r--r-- | tests/cmdline/cmd_parsetree.py.exp | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/py/parse.c b/py/parse.c index f0e0a165c..8f0a25cf2 100644 --- a/py/parse.c +++ b/py/parse.c @@ -394,10 +394,12 @@ void mp_parse_node_print(const mp_print_t *print, mp_parse_node_t pn, size_t ind if (MP_PARSE_NODE_STRUCT_KIND(pns) == RULE_const_object) { mp_obj_t obj = mp_parse_node_extract_const_object(pns); #if MICROPY_OBJ_REPR == MICROPY_OBJ_REPR_D - mp_printf(print, "literal const(%016llx)\n", obj); + mp_printf(print, "literal const(%016llx)=", obj); #else - mp_printf(print, "literal const(%p)\n", obj); + mp_printf(print, "literal const(%p)=", obj); #endif + mp_obj_print_helper(print, obj, PRINT_REPR); + mp_printf(print, "\n"); } else { size_t n = MP_PARSE_NODE_STRUCT_NUM_NODES(pns); #if MICROPY_DEBUG_PARSE_RULE_NAME diff --git a/tests/cmdline/cmd_parsetree.py.exp b/tests/cmdline/cmd_parsetree.py.exp index 6ee96b7ca..7f9aa047e 100644 --- a/tests/cmdline/cmd_parsetree.py.exp +++ b/tests/cmdline/cmd_parsetree.py.exp @@ -31,7 +31,7 @@ [ 13] \(rule\|expr_stmt\)(5) (n=2) id(h) [ 13] \(rule\|atom_expr_normal\)(44) (n=2) -[ 13] literal const(\.\+) +[ 13] literal const(\.\+)="fstring: '{}'" [ 13] \(rule\|atom_expr_trailers\)(142) (n=2) [ 13] \(rule\|trailer_period\)(50) (n=1) id(format) |
