summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-12-22 10:56:11 +1100
committerDamien George <damien.p.george@gmail.com>2016-12-22 10:56:11 +1100
commitebb84131788ca1134d0c9cf38fcb1e5162c14bc3 (patch)
tree6a93961caa064b13756d970f5e095e36fc5f11c7
parentc305ae32436e37327d33df979d57d9ac1fb822c1 (diff)
downloadmicropython-ebb84131788ca1134d0c9cf38fcb1e5162c14bc3.tar.gz
micropython-ebb84131788ca1134d0c9cf38fcb1e5162c14bc3.zip
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).
-rw-r--r--unix/main.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/unix/main.c b/unix/main.c
index 482d1944e2..f67c257cd7 100644
--- a/unix/main.c
+++ b/unix/main.c
@@ -113,11 +113,14 @@ STATIC int execute_from_lexer(mp_lexer_t *lex, mp_parse_input_kind_t input_kind,
mp_parse_tree_t parse_tree = mp_parse(lex, input_kind);
- /*
- printf("----------------\n");
- mp_parse_node_print(parse_tree.root, 0);
- printf("----------------\n");
- */
+ #if defined(MICROPY_UNIX_COVERAGE)
+ // allow to print the parse tree in the coverage build
+ if (mp_verbose_flag >= 3) {
+ printf("----------------\n");
+ mp_parse_node_print(parse_tree.root, 0);
+ printf("----------------\n");
+ }
+ #endif
mp_obj_t module_fun = mp_compile(&parse_tree, source_name, emit_opt, is_repl);