elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
_add_implicit_to_given_when_blocks {
# given($foo)
# when($bar) means when ($foo ~~ $bar)
# when(\@list) means when ($foo ~~ \@list)
# when(&func) means
n element
# if there is an "implicit smart match",
# insert << $_ ~~ >> at the beginning of the struct
my $given_child = $given->find('PPI::Structure::Given') or
$e eq '<=>' || $e eq 'cmp' || $e eq '!' || $e eq 'not' ||
$e eq '^' || $e eq 'xor' || $e eq '~~' || $e eq '..')) {
$is_implicit_smart_match = 0;
last;
} elsif (ref($e) =~ /::Regexp/) {
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |
elsif (/\G ((?>\s+)|\#.*) /oxgc) { return $1; }
# if (, elsif (, unless (, while (, until (, given (, and when (
# given, when
# P.225 The given Statement
# in Chapter 15: Smart Matc
Operators
# of ISBN 978-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
# ~~
# P.221 The Smart Match Operator
# in Chapter 15: Smart Matching and given-when
# of
-0-596-00492-7 Programming Perl 4th Edition.
# (and so on)
elsif (/\G ((?>
!~~ | !~ | != | ! |
%= | % |
&&= | && | &= | &\.= | &\. | & |
-= |