diff options
Diffstat (limited to 'unix/main.c')
-rw-r--r-- | unix/main.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/unix/main.c b/unix/main.c index 39a772d1eb..35fca2059a 100644 --- a/unix/main.c +++ b/unix/main.c @@ -53,9 +53,11 @@ static void execute_from_lexer(mp_lexer_t *lex, mp_parse_input_kind_t input_kind qstr source_name = mp_lexer_source_name(lex); mp_lexer_free(lex); - //printf("----------------\n"); - //mp_parse_node_show(pn, 0); - //printf("----------------\n"); + /* + printf("----------------\n"); + mp_parse_node_print(pn, 0); + printf("----------------\n"); + */ mp_obj_t module_fun = mp_compile(pn, source_name, is_repl); @@ -73,10 +75,10 @@ static void execute_from_lexer(mp_lexer_t *lex, mp_parse_input_kind_t input_kind // uncaught exception mp_obj_t exc = (mp_obj_t)nlr.ret_val; if (MP_OBJ_IS_TYPE(exc, &exception_type)) { - qstr file; + qstr file, block; machine_uint_t line; - mp_obj_exception_get_source_info(exc, &file, &line); - printf("File \"%s\", line %d\n", qstr_str(file), (int)line); + mp_obj_exception_get_source_info(exc, &file, &line, &block); + printf("File \"%s\", line %d, in %s\n", qstr_str(file), (int)line, qstr_str(block)); } mp_obj_print(exc, PRINT_REPR); printf("\n"); |