From 768318b83da36cf3ab22b9ad4cb19c47630a8ed6 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sun, 29 May 2011 21:03:58 -0600 Subject: Add inversion list dump routine, #ifdef'd out to prevent compiler warning, for use when debugging --- regcomp.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'regcomp.c') diff --git a/regcomp.c b/regcomp.c index 884930968a..d658169270 100644 --- a/regcomp.c +++ b/regcomp.c @@ -6582,6 +6582,30 @@ S_invlist_iternext(pTHX_ SV* invlist, UV* start, UV* end) return TRUE; } +#if 0 +void +S_invlist_dump(pTHX_ SV* const invlist, const char * const header) +{ + /* Dumps out the ranges in an inversion list. The string 'header' + * if present is output on a line before the first range */ + + UV start, end; + + if (header && strlen(header)) { + PerlIO_printf(Perl_debug_log, "%s\n", header); + } + invlist_iterinit(invlist); + while (invlist_iternext(invlist, &start, &end)) { + if (end == UV_MAX) { + PerlIO_printf(Perl_debug_log, "0x%04"UVXf" .. INFINITY\n", start); + } + else { + PerlIO_printf(Perl_debug_log, "0x%04"UVXf" .. 0x%04"UVXf"\n", start, end); + } + } +} +#endif + #undef HEADER_LENGTH #undef INVLIST_INITIAL_LENGTH #undef TO_INTERNAL_SIZE -- cgit v1.2.1