diff options
author | Zefram <zefram@fysh.org> | 2017-12-06 00:09:42 +0000 |
---|---|---|
committer | Zefram <zefram@fysh.org> | 2017-12-06 00:09:42 +0000 |
commit | f68519ee3f12e5ba41a022ef88ce3d6c3901807f (patch) | |
tree | d28e0491a89f13c137a35d52c17fb0f6e37af773 /lib/B/Deparse.t | |
parent | 84ac76a7475419f4ac6e5a6935522f7b7ebb0e2c (diff) | |
download | perl-f68519ee3f12e5ba41a022ef88ce3d6c3901807f.tar.gz |
add "whereis"
"whereis" is like "whereso" except that it performs an implicit
smartmatch.
Diffstat (limited to 'lib/B/Deparse.t')
-rw-r--r-- | lib/B/Deparse.t | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/B/Deparse.t b/lib/B/Deparse.t index b8d98caefc..e90cbed93d 100644 --- a/lib/B/Deparse.t +++ b/lib/B/Deparse.t @@ -1028,7 +1028,8 @@ my $d = \[]; # implicit smartmatch in given/whereso given ('foo') { whereso ('bar') { continue; } - whereso ($_ ~~ 'quux') { continue; } + whereso ($_ == 3) { continue; } + whereis ('quux') { continue; } 0; } #### @@ -1514,6 +1515,9 @@ CORE::given ($x) { CORE::whereso (3) { continue; } + CORE::whereis (5) { + continue; + } next; } CORE::evalbytes ''; @@ -1530,6 +1534,9 @@ CORE::given ($x) { CORE::whereso (3) { continue; } + CORE::whereis (5) { + continue; + } next; } CORE::evalbytes ''; @@ -1541,6 +1548,9 @@ CORE::given ($x) { CORE::whereso (3) { continue; } + CORE::whereis (5) { + continue; + } next; } CORE::evalbytes ''; @@ -1557,6 +1567,9 @@ CORE::given ($x) { CORE::whereso (3) { continue; } + CORE::whereis (5) { + continue; + } next; } CORE::evalbytes ''; @@ -1570,6 +1583,9 @@ CORE::given ($x) { CORE::whereso (3) { continue; } + CORE::whereis (5) { + continue; + } next; } CORE::evalbytes ''; @@ -1598,6 +1614,7 @@ my sub tr; my sub unless; my sub until; my sub use; +my sub whereis; my sub whereso; my sub while; CORE::if ($1) { die; } @@ -1621,6 +1638,7 @@ CORE::unless ($1) { die; } CORE::until ($1) { die; } die CORE::until $1; CORE::use strict; +CORE::whereis (5) { die; } CORE::whereso ($1 ~~ $2) { die; } CORE::while ($1) { die; } die CORE::while $1; |