From: K.Kosako Date: Fri, 28 Sep 2018 05:59:57 +0000 (+0900) Subject: output string-ambig in print_indent_tree() X-Git-Tag: v6.9.1~18^2~43 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=86740891067b012380a26ef201a245ba584310a4;p=onig output string-ambig in print_indent_tree() --- diff --git a/src/regcomp.c b/src/regcomp.c index dd2bfa7..4ad77f2 100644 --- a/src/regcomp.c +++ b/src/regcomp.c @@ -6505,12 +6505,23 @@ print_indent_tree(FILE* f, Node* node, int indent) break; case NODE_STRING: - fprintf(f, "", (NODE_STRING_IS_RAW(node) ? "-raw" : ""), node); - for (p = STR_(node)->s; p < STR_(node)->end; p++) { - if (*p >= 0x20 && *p < 0x7f) - fputc(*p, f); - else { - fprintf(f, " 0x%02x", *p); + { + char* mode; + + if (NODE_STRING_IS_RAW(node)) + mode = "-raw"; + else if (NODE_STRING_IS_AMBIG(node)) + mode = "-ambig"; + else + mode = ""; + + fprintf(f, "", mode, node); + for (p = STR_(node)->s; p < STR_(node)->end; p++) { + if (*p >= 0x20 && *p < 0x7f) + fputc(*p, f); + else { + fprintf(f, " 0x%02x", *p); + } } } break;