diff options
author | Gerard Goossen <gerard@tty.nl> | 2007-06-26 22:33:50 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-07-07 08:03:49 +0000 |
commit | b3f5cf18528ca19187726d11aa6582cb64debc65 (patch) | |
tree | a4755ba070818fdb6044cadc6217abad0f065728 /mad/Nomad.pm | |
parent | cbd87e7ef183ffa0dd4ce9a35b2df1221f037667 (diff) | |
download | perl-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-x | mad/Nomad.pm | 5 |
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]); |