summaryrefslogtreecommitdiff
path: root/mad/Nomad.pm
diff options
context:
space:
mode:
authorGerard Goossen <gerard@tty.nl>2007-06-26 22:33:50 +0200
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-07-07 08:03:49 +0000
commitb3f5cf18528ca19187726d11aa6582cb64debc65 (patch)
treea4755ba070818fdb6044cadc6217abad0f065728 /mad/Nomad.pm
parentcbd87e7ef183ffa0dd4ce9a35b2df1221f037667 (diff)
downloadperl-b3f5cf18528ca19187726d11aa6582cb64debc65.tar.gz
p55: correctly translate things like s//$#foo/ge
Message-ID: <20070626183350.GA11336@ostwald> p4raw-id: //depot/perl@31552
Diffstat (limited to 'mad/Nomad.pm')
-rwxr-xr-xmad/Nomad.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/mad/Nomad.pm b/mad/Nomad.pm
index 4fdd3a89ee..5ccda4ff90 100755
--- a/mad/Nomad.pm
+++ b/mad/Nomad.pm
@@ -1683,7 +1683,10 @@ sub ast {
if ($rfirst[-1]->uni ne $llast[-1]->uni) {
push @newkids, @rfirst;
}
-
+ # remove the fake '\n' if /e and '#' in replacement.
+ if (@mods and $mods[0] =~ m/e/ and ($self->madness('R'))[0]->uni =~ m/#/) {
+ unshift @rlast, bless {}, 'chomp'; # hack to remove '\n'
+ }
push @newkids, $bits->{repl}, @rlast, @mods;
my $retval = $self->newtype->new(Kids => [@newkids]);