Skip to content

Commit ebb8413

Browse files
committed
unix/main: Allow to print the parse tree in coverage build.
Passing -v -v -v on the command line of the coverage build will now print the parse tree (as well as other things at this verbosity level).
1 parent c305ae3 commit ebb8413

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

unix/main.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,14 @@ STATIC int execute_from_lexer(mp_lexer_t *lex, mp_parse_input_kind_t input_kind,
113113

114114
mp_parse_tree_t parse_tree = mp_parse(lex, input_kind);
115115

116-
/*
117-
printf("----------------\n");
118-
mp_parse_node_print(parse_tree.root, 0);
119-
printf("----------------\n");
120-
*/
116+
#if defined(MICROPY_UNIX_COVERAGE)
117+
// allow to print the parse tree in the coverage build
118+
if (mp_verbose_flag >= 3) {
119+
printf("----------------\n");
120+
mp_parse_node_print(parse_tree.root, 0);
121+
printf("----------------\n");
122+
}
123+
#endif
121124

122125
mp_obj_t module_fun = mp_compile(&parse_tree, source_name, emit_opt, is_repl);
123126

0 commit comments

Comments
 (0)