diff options
author | David Mitchell <davem@iabyn.com> | 2017-02-23 10:53:10 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2017-06-05 12:52:17 +0100 |
commit | 4d7ac81a3c0ccb379bb5cb05d2c845b706f7289b (patch) | |
tree | b4b15b04711ee8c231efeb70c09e96118bb68106 /lib/B/Deparse.t | |
parent | 27daf5669559d9755c5886825536aefd01d540ca (diff) | |
download | perl-4d7ac81a3c0ccb379bb5cb05d2c845b706f7289b.tar.gz |
Deparse: don't remove escapes for tabs in patterns
In the following, the T represents a literal tab character.
/\T/ and /\T/x were being deparsed as /T/ and /T/x.
In the particular case of /\T/x that actually changed the pattern's
meaning.
So don't do that: leave the backslashes alone.
This makes
./TEST -deparse t/re/keep_tabs.t
pass.
Diffstat (limited to 'lib/B/Deparse.t')
-rw-r--r-- | lib/B/Deparse.t | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/B/Deparse.t b/lib/B/Deparse.t index 381cc2fc9d..4361967e6e 100644 --- a/lib/B/Deparse.t +++ b/lib/B/Deparse.t @@ -2621,3 +2621,9 @@ my $a; /$a(?{ my($x, $y) = (); })/; my $r1 = qr/(?{ my($x, $y) = (); })/; my $r2 = qr/$a(?{ my($x, $y) = (); })/; +#### +# don't remove pattern whitespace escapes +/a\ b/; +/a\ b/x; +/a\ b/; +/a\ b/x; |