summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-05-29 21:03:58 -0600
committerKarl Williamson <public@khwilliamson.com>2011-07-03 14:05:47 -0600
commit768318b83da36cf3ab22b9ad4cb19c47630a8ed6 (patch)
tree9a456cb21f061688abdb3f49bb2c0e70c1fe2efb /regcomp.c
parent024707869a10c357d61d9dfdfe74a7b386c92e25 (diff)
downloadperl-768318b83da36cf3ab22b9ad4cb19c47630a8ed6.tar.gz
Add inversion list dump routine, #ifdef'd out to prevent compiler warning, for use when debugging
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c24
1 files changed, 24 insertions, 0 deletions
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