From: K.Kosako Date: Thu, 10 Oct 2019 23:58:38 +0000 (+0900) Subject: add output parsed tree before setup() in ONIG_DEBUG_PARSE mode X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a638789038be5adceb7e3be74fb37a6a4f6d6c6d;p=onig add output parsed tree before setup() in ONIG_DEBUG_PARSE mode --- diff --git a/src/regcomp.c b/src/regcomp.c index addc46b..b7cca2d 100644 --- a/src/regcomp.c +++ b/src/regcomp.c @@ -6639,6 +6639,13 @@ onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end, reg->num_call = scan_env.num_call; #endif +#ifdef ONIG_DEBUG_PARSE + fprintf(stderr, "MAX PARSE DEPTH: %d\n", scan_env.max_parse_depth); + fprintf(stderr, "TREE (parsed)\n"); + print_tree(stderr, root); + fprintf(stderr, "\n"); +#endif + r = setup_tree(root, reg, 0, &scan_env); if (r != 0) goto err_unset; @@ -6650,8 +6657,9 @@ onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end, } #ifdef ONIG_DEBUG_PARSE - fprintf(stderr, "MAX PARSE DEPTH: %d\n", scan_env.max_parse_depth); + fprintf(stderr, "TREE (after setup)\n"); print_tree(stderr, root); + fprintf(stderr, "\n"); #endif reg->capture_history = scan_env.cap_history;