This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix deparsing of require "a".$1
[perl5.git] / dist / B-Deparse / t / deparse.t
index 056c9cf..22f2cb5 100644 (file)
@@ -399,6 +399,13 @@ my $f = sub {
 # bug #43010
 &::::;
 ####
+# [perl #77172]
+package rt77172;
+sub foo {} foo & & & foo;
+>>>>
+package rt77172;
+foo(&{&} & foo());
+####
 # variables as method names
 my $bar;
 'Foo'->$bar('orz');
@@ -837,9 +844,16 @@ print $_;
 # [perl #47361] do({}) and do +{} (variants of do-file)
 do({});
 do +{};
+sub foo::do {}
+package foo;
+CORE::do({});
+CORE::do +{};
 >>>>
 do({});
 do({});
+package foo;
+CORE::do({});
+CORE::do({});
 ####
 # [perl #77096] functions that do not follow the llafr
 () = (return 1) + time;
@@ -851,7 +865,34 @@ do({});
 () = (goto 1) + 3;
 () = (require 'foo') + 3;
 () = (require foo) + 3;
-() = (dump 1) + 3;
+() = (CORE::dump 1) + 3;
 () = (last 1) + 3;
 () = (next 1) + 3;
 () = (redo 1) + 3;
+() = (-R $_) + 3;
+() = (-W $_) + 3;
+() = (-X $_) + 3;
+() = (-r $_) + 3;
+() = (-w $_) + 3;
+() = (-x $_) + 3;
+####
+# [perl #97476] not() *does* follow the llafr
+$_ = ($a xor not +($1 || 2) ** 2);
+####
+# Precedence conundrums with argument-less function calls
+() = (eof) + 1;
+() = (return) + 1;
+() = (return, 1);
+() = warn;
+() = warn() + 1;
+() = setpgrp() + 1;
+####
+# [perl #63558] open local(*FH)
+open local *FH;
+pipe local *FH, local *FH;
+####
+# [perl #74740] -(f()) vs -f()
+$_ = -(f());
+####
+# require <binop>
+require 'a' . $1;