This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Use available mnemonics for dumping regex
authorKarl Williamson <khw@cpan.org>
Sat, 23 Aug 2014 23:54:20 +0000 (17:54 -0600)
committerKarl Williamson <khw@cpan.org>
Mon, 25 Aug 2014 17:13:40 +0000 (11:13 -0600)
Perl supports \e and \b (in bracketed character classes).  Use these on
outputting like we do \t and \n, instead of a hex value

regcomp.c

index e131e70..7860242 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -16675,6 +16675,8 @@ S_put_byte(pTHX_ SV *sv, int c)
     if (!isPRINT(c)) {
         switch (c) {
             case '\a': Perl_sv_catpvf(aTHX_ sv, "\\a"); break;
+            case '\b': Perl_sv_catpvf(aTHX_ sv, "\\b"); break;
+            case ESC_NATIVE: Perl_sv_catpvf(aTHX_ sv, "\\e"); break;
             case '\f': Perl_sv_catpvf(aTHX_ sv, "\\f"); break;
             case '\n': Perl_sv_catpvf(aTHX_ sv, "\\n"); break;
             case '\r': Perl_sv_catpvf(aTHX_ sv, "\\r"); break;