sub semiparse ($) {
($_) = @_;
my @o;
+ #my $in = $_;
# entries contain
# T type
# E exact input text (does not contain here doc contents)
push @o, { T => 'heredoc', Q => $q, Delim => $d,
E => $&, P => "<<$q$d$q" };
s{^
- ( .* \n )
- ( (?: (?! $d) .* \n )* )
- $d \n
+ ( .* \n )
+ ( (?: (?! $d \n ) .* \n )*? )
+ $d \n
}{ $1 }xe or die "missing end of here doc $d\n";
$o[$#o]{V} = $2;
} elsif (s{^ (["'])( (?: [^\\'"]
$xs = substr($xs, length($lit));
};
for (;;) {
+ #print STDERR Dumper($fmt, $xs, \@xs, @ys);
if ($fmt !~ m{\%[^\%]}) {
$exactly->($fmt, '(tail)');
$fmt = '';
- die "text deleted from end of string\n" if length $xs;
+ die "text deleted from end of string: ".qp($xs)."\n"
+ if length $xs;
last;
}
$exactly->($`, '(literal)');