@@ -164,6 +164,7 @@ recursive, but it's recursive on basic blocks, not on tree nodes.
164
164
#include "keywords.h"
165
165
#include "feature.h"
166
166
#include "regcomp.h"
167
+ #include "invlist_inline.h"
167
168
168
169
#define CALL_PEEP(o) PL_peepp(aTHX_ o)
169
170
#define CALL_RPEEP(o) PL_rpeepp(aTHX_ o)
@@ -6713,6 +6714,46 @@ Perl_newBINOP(pTHX_ I32 type, I32 flags, OP *first, OP *last)
6713
6714
return fold_constants(op_integerize(op_std_init((OP *)binop)));
6714
6715
}
6715
6716
6717
+ void
6718
+ Perl_invmap_dump(pTHX_ SV* invlist, UV *map)
6719
+ {
6720
+ const char indent[] = " ";
6721
+
6722
+ UV len = _invlist_len(invlist);
6723
+ UV * array = invlist_array(invlist);
6724
+ UV i;
6725
+
6726
+ PERL_ARGS_ASSERT_INVMAP_DUMP;
6727
+
6728
+ for (i = 0; i < len; i++) {
6729
+ UV start = array[i];
6730
+ UV end = (i + 1 < len) ? array[i+1] - 1 : IV_MAX;
6731
+
6732
+ PerlIO_printf(Perl_debug_log, "%s[%" UVuf "] 0x%04" UVXf, indent, i, start);
6733
+ if (end == IV_MAX) {
6734
+ PerlIO_printf(Perl_debug_log, " .. INFTY");
6735
+ }
6736
+ else if (end != start) {
6737
+ PerlIO_printf(Perl_debug_log, " .. 0x%04" UVXf, end);
6738
+ }
6739
+ else {
6740
+ PerlIO_printf(Perl_debug_log, " ");
6741
+ }
6742
+
6743
+ PerlIO_printf(Perl_debug_log, "\t");
6744
+
6745
+ if (map[i] == TR_UNLISTED) {
6746
+ PerlIO_printf(Perl_debug_log, "TR_UNLISTED\n");
6747
+ }
6748
+ else if (map[i] == TR_SPECIAL_HANDLING) {
6749
+ PerlIO_printf(Perl_debug_log, "TR_SPECIAL_HANDLING\n");
6750
+ }
6751
+ else {
6752
+ PerlIO_printf(Perl_debug_log, "0x%04" UVXf "\n", map[i]);
6753
+ }
6754
+ }
6755
+ }
6756
+
6716
6757
/* Helper function for S_pmtrans(): comparison function to sort an array
6717
6758
* of codepoint range pairs. Sorts by start point, or if equal, by end
6718
6759
* point */
0 commit comments