my $state = $kid->first;
my $cuddle = $self->{'cuddle'};
my($expr, @exprs);
- for (; $$state != $$cont; $state = $state->sibling) {
+ for (; $$state != $$cont and can $state "sibling"; $state = $state->sibling) {
$expr = "";
if (is_state $state) {
$expr = $self->deparse($state, 0);
push @exprs, $expr if $expr;
}
$kid = join(";\n", @exprs);
+ if (class($cont) eq "LISTOP") {
$cont = $cuddle . "continue {\n\t" .
$self->deparse($cont, 0) . "\n\b}\cK";
+ } else {
+ $cont = "\cK";
+ }
} else {
$cont = "\cK";
$kid = $self->deparse($kid, 0);
use strict;
use Config;
-print "1..15\n";
+print "1..17\n";
my $test = 1;
@F = split(/\s+/, $_, 0);
'???'
}
-continue {
- '???'
-}
EOF
print "# [$a]\n\# vs\n# [$b]\nnot " if $a ne $b;
print "# [$a]\nnot " unless $a =~ /sv_undef.*PVNV.*%one.*sv_undef.*HV/s;
}
ok;
+
+# Bug 20001204.07
+{
+my $foo = $deparse->coderef2text(sub { { 234; }});
+# Constants don't get optimised here.
+print "not " unless $foo =~ /{.*{.*234;.*}.*}/sm;
+ok;
+$foo = $deparse->coderef2text(sub { { 234; } continue { 123; } });
+print "not " unless $foo =~ /{.*{.*234;.*}.*continue.*{.*123.*}/sm;
+ok;
+}