summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2010-12-19 11:08:47 -0700
committerKarl Williamson <public@khwilliamson.com>2010-12-19 20:21:56 -0700
commitc89df6cf6f70d6460ca3fec9d465e5e6e17fb3a7 (patch)
tree95e7d58cf1dc4fd257fe694d24697f6393e4eaa8
parent681f01c2a5ff0846090d78599b3d4caeb93fda26 (diff)
downloadperl-c89df6cf6f70d6460ca3fec9d465e5e6e17fb3a7.tar.gz
Change regexes to debug dump non-ASCII as hex.
instead of the less familiar octal for larger values. Perhaps they should actually print the actual character, but this is far easier than the previous to understand.
-rw-r--r--perl.h2
-rw-r--r--regcomp.c1
-rw-r--r--regcomp.h6
-rw-r--r--regexec.c2
4 files changed, 6 insertions, 5 deletions
diff --git a/perl.h b/perl.h
index 40e0dd3c01..567150d6c9 100644
--- a/perl.h
+++ b/perl.h
@@ -6170,7 +6170,7 @@ extern void moncontrol(int);
/* used by pv_display in dump.c*/
#define PERL_PV_PRETTY_DUMP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_QUOTE
-#define PERL_PV_PRETTY_REGPROP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_LTGT|PERL_PV_ESCAPE_RE
+#define PERL_PV_PRETTY_REGPROP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_LTGT|PERL_PV_ESCAPE_RE|PERL_PV_ESCAPE_NONASCII
/*
diff --git a/regcomp.c b/regcomp.c
index fb9c606cba..122c560205 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -9610,6 +9610,7 @@ Perl_regprop(pTHX_ const regexp *prog, SV *sv, const regnode *o)
* --jhi */
pv_pretty(sv, STRING(o), STR_LEN(o), 60, PL_colors[0], PL_colors[1],
PERL_PV_ESCAPE_UNI_DETECT |
+ PERL_PV_ESCAPE_NONASCII |
PERL_PV_PRETTY_ELLIPSES |
PERL_PV_PRETTY_LTGT |
PERL_PV_PRETTY_NOCLEAR
diff --git a/regcomp.h b/regcomp.h
index c140089093..00fd94517f 100644
--- a/regcomp.h
+++ b/regcomp.h
@@ -822,20 +822,20 @@ re.pm, especially to the documentation.
const char * const rpv = \
pv_pretty((dsv), (pv), (l), (m), \
PL_colors[(c1)],PL_colors[(c2)], \
- PERL_PV_ESCAPE_RE |((isuni) ? PERL_PV_ESCAPE_UNI : 0) ); \
+ PERL_PV_ESCAPE_RE|PERL_PV_ESCAPE_NONASCII |((isuni) ? PERL_PV_ESCAPE_UNI : 0) ); \
const int rlen = SvCUR(dsv)
#define RE_SV_ESCAPE(rpv,isuni,dsv,sv,m) \
const char * const rpv = \
pv_pretty((dsv), (SvPV_nolen_const(sv)), (SvCUR(sv)), (m), \
PL_colors[(c1)],PL_colors[(c2)], \
- PERL_PV_ESCAPE_RE |((isuni) ? PERL_PV_ESCAPE_UNI : 0) )
+ PERL_PV_ESCAPE_RE|PERL_PV_ESCAPE_NONASCII |((isuni) ? PERL_PV_ESCAPE_UNI : 0) )
#define RE_PV_QUOTED_DECL(rpv,isuni,dsv,pv,l,m) \
const char * const rpv = \
pv_pretty((dsv), (pv), (l), (m), \
PL_colors[0], PL_colors[1], \
- ( PERL_PV_PRETTY_QUOTE | PERL_PV_ESCAPE_RE | PERL_PV_PRETTY_ELLIPSES | \
+ ( PERL_PV_PRETTY_QUOTE | PERL_PV_ESCAPE_RE | PERL_PV_ESCAPE_NONASCII | PERL_PV_PRETTY_ELLIPSES | \
((isuni) ? PERL_PV_ESCAPE_UNI : 0)) \
)
diff --git a/regexec.c b/regexec.c
index 591018aeff..2fd8af25b3 100644
--- a/regexec.c
+++ b/regexec.c
@@ -3493,7 +3493,7 @@ S_regmatch(pTHX_ regmatch_info *reginfo, regnode *prog)
ST.nextword,
tmp ? pv_pretty(sv, SvPV_nolen_const(*tmp), SvCUR(*tmp), 0,
PL_colors[0], PL_colors[1],
- (SvUTF8(*tmp) ? PERL_PV_ESCAPE_UNI : 0)
+ (SvUTF8(*tmp) ? PERL_PV_ESCAPE_UNI : 0)|PERL_PV_ESCAPE_NONASCII
)
: "not compiled under -Dr",
PL_colors[5] );