diff options
Diffstat (limited to 'mad')
-rwxr-xr-x | mad/Nomad.pm | 5 | ||||
-rw-r--r-- | mad/P5AST.pm | 3 | ||||
-rw-r--r-- | mad/t/p55.t | 11 |
3 files changed, 13 insertions, 6 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]); diff --git a/mad/P5AST.pm b/mad/P5AST.pm index d253c86057..eaf3bd3e20 100644 --- a/mad/P5AST.pm +++ b/mad/P5AST.pm @@ -75,6 +75,9 @@ sub p5text { } $text .= $newtext; } + elsif ($type eq "chomp") { + $text =~ s/\n$//g; + } elsif ($type) { $text .= $kid->p5text(@_); } diff --git a/mad/t/p55.t b/mad/t/p55.t index ef4c397e3b..f3addd113c 100644 --- a/mad/t/p55.t +++ b/mad/t/p55.t @@ -62,8 +62,6 @@ use File::Find; use Test::Differences; our %failing = map { $_, 1 } qw| -../t/op/subst.t - ../t/comp/require.t ../t/io/layers.t @@ -83,6 +81,9 @@ our %failing = map { $_, 1 } qw| ../t/op/symbolcache.t ../t/op/threads.t + +../t/op/exec.t +../t/io/say.t |; my @files; @@ -139,13 +140,13 @@ for (my $i=0; $i<3; $i++) { } ######## for (; $a<3; $a++) { } ######## -# TODO +# s//$#foo/ge; ######## -# TODO +# s//m#.#/ge; ######## -# TODO +# eval { require 5.005 } ######## # TODO Reduced test case from t/io/layers.t |