sub madness {
my $self = shift;
my @keys = split(' ', shift);
+ @keys = map { $_ eq 'd' ? ('k', 'd') : $_ } @keys;
my @vals = ();
for my $key (@keys) {
my $madprop = $self->{mp}{$key};
for my $kid (@{$$self{Kids}}) {
my ($k,$v) = $kid->pair($self, @_);
$firstthing ||= $k;
- if ($k =~ /^[_#]$/) { # rekey whitespace according to preceding entry
- $k .= $lastthing; # (which is actually the token the whitespace is before)
- }
- else {
- $k .= 'x' while exists $hash{$k};
- $lastthing = $k;
- }
+ $k .= 'x' while exists $hash{$k};
+ $lastthing = $k;
$hash{$k} = $v;
}
$hash{FIRST} = $firstthing;
return P5AST::listop->new(Kids => [@before,@retval]);
}
- push @retval, $self->madness('o ( [ {');
+ push @retval, $self->madness('o d ( [ {');
my @newkids;
for my $kid (@{$$self{Kids}}) {
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]);
package PLXML::op_leavewrite;
package PLXML::op_prtf;
package PLXML::op_print;
+package PLXML::op_say;
package PLXML::op_sysopen;
package PLXML::op_sysseek;
package PLXML::op_sysread;