From 31c26a0ab02a6b3eb8374c348613c00a317dc365 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Wed, 22 Aug 2012 18:15:11 -0700 Subject: [PATCH] B::Deparse: Suppress trailing ; in formats MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit While it doesn’t change the behaviour, nobody writes formats that way, and this makes the output match 5.17.2 and earlier. --- dist/B-Deparse/Deparse.pm | 1 + dist/B-Deparse/t/deparse.t | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/B-Deparse/Deparse.pm b/dist/B-Deparse/Deparse.pm index 34fc38c..b4bcd54 100644 --- a/dist/B-Deparse/Deparse.pm +++ b/dist/B-Deparse/Deparse.pm @@ -941,6 +941,7 @@ sub deparse_format { $kid = $kid->sibling; for (; not null $kid; $kid = $kid->sibling) { push @exprs, $self->deparse($kid, -1); + $exprs[-1] =~ s/;\z//; } push @text, "\f".join(", ", @exprs)."\n" if @exprs; $op = $op->sibling; diff --git a/dist/B-Deparse/t/deparse.t b/dist/B-Deparse/t/deparse.t index 841d531..2d75050 100644 --- a/dist/B-Deparse/t/deparse.t +++ b/dist/B-Deparse/t/deparse.t @@ -246,7 +246,6 @@ SKIP: { # multiple statements on format lines $a = `$^X $path "-MO=Deparse" -e "format =" -e "\@" -e "x();z()" -e. 2>&1`; $a =~ s/-e syntax OK\n//g; -$a =~ s/z\(\);/z()/; is($a, <<'EOCODH', 'multiple statements on format lines'); format STDOUT = @ -- 2.7.4