| 1 | package Perl6::Junction::One; | ||||||||||
| 2 | 8 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 8 | our $VERSION = '1.60000'; | |||||||||
| 4 | |||||||||||
| 5 | 8 | ▶ | use base 'Perl6::Junction::Base'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 17 | ▶ | sub num_eq { | ||||||||
|
Subroutine
num_eq: called CC=6 SCAR=17.9
Pod
undocumented
| |||||||||||
| 8 | 17 | ▶ | return regex_eq(@_) if ref( $_[1] ) eq 'Regexp'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 9 | |||||||||||
| 10 | 12 | my ( $self, $test ) = @_; | |||||||||
| 11 | 12 | my $count = 0; | |||||||||
| 12 | |||||||||||
| 13 | 12 | for (@$self) { | |||||||||
| 14 | 27 | ▶ | if ( $_ == $test ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 15 | 12 | ▶ | return if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | 10 | $count = 1; | |||||||||
| 17 | } | ||||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | 10 | ▶ | return 1 if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | 7 | ▶ | sub num_ne { | ||||||||
|
Subroutine
num_ne: called CC=6 SCAR=17.9
Pod
undocumented
| |||||||||||
| 24 | 7 | ▶ | return regex_ne(@_) if ref( $_[1] ) eq 'Regexp'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | |||||||||||
| 26 | 3 | my ( $self, $test ) = @_; | |||||||||
| 27 | 3 | my $count = 0; | |||||||||
| 28 | |||||||||||
| 29 | 3 | for (@$self) { | |||||||||
| 30 | 6 | ▶ | if ( $_ != $test ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | 3 | ▶ | return if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | 2 | $count = 1; | |||||||||
| 33 | } | ||||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | 2 | ▶ | return 1 if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | } | ||||||||||
| 38 | |||||||||||
| 39 | 17 | ▶ | sub num_ge { | ||||||||
|
Subroutine
num_ge: called CC=6 SCAR=17.9
Pod
undocumented
| |||||||||||
| 40 | 17 | my ( $self, $test, $switch ) = @_; | |||||||||
| 41 | |||||||||||
| 42 | 17 | ▶ | return num_le( $self, $test ) if $switch; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 43 | |||||||||||
| 44 | 10 | my $count = 0; | |||||||||
| 45 | |||||||||||
| 46 | 10 | for (@$self) { | |||||||||
| 47 | 29 | ▶ | if ( $_ >= $test ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 48 | 11 | ▶ | return if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 49 | 8 | $count = 1; | |||||||||
| 50 | } | ||||||||||
| 51 | } | ||||||||||
| 52 | |||||||||||
| 53 | 7 | ▶ | return 1 if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 54 | } | ||||||||||
| 55 | |||||||||||
| 56 | 12 | ▶ | sub num_gt { | ||||||||
|
Subroutine
num_gt: called CC=6 SCAR=17.9
Pod
undocumented
| |||||||||||
| 57 | 12 | my ( $self, $test, $switch ) = @_; | |||||||||
| 58 | |||||||||||
| 59 | 12 | ▶ | return num_lt( $self, $test ) if $switch; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 60 | |||||||||||
| 61 | 8 | my $count = 0; | |||||||||
| 62 | |||||||||||
| 63 | 8 | for (@$self) { | |||||||||
| 64 | 23 | ▶ | if ( $_ > $test ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 65 | 8 | ▶ | return if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 66 | 6 | $count = 1; | |||||||||
| 67 | } | ||||||||||
| 68 | } | ||||||||||
| 69 | |||||||||||
| 70 | 6 | ▶ | return 1 if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 71 | } | ||||||||||
| 72 | |||||||||||
| 73 | 14 | ▶ | sub num_le { | ||||||||
|
Subroutine
num_le: called CC=6 SCAR=17.9
Pod
undocumented
| |||||||||||
| 74 | 14 | my ( $self, $test, $switch ) = @_; | |||||||||
| 75 | |||||||||||
| 76 | 14 | ▶ | return num_ge( $self, $test ) if $switch; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 77 | |||||||||||
| 78 | 11 | my $count = 0; | |||||||||
| 79 | |||||||||||
| 80 | 11 | for (@$self) { | |||||||||
| 81 | 23 | ▶ | if ( $_ <= $test ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 82 | 11 | ▶ | return if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 83 | 9 | $count = 1; | |||||||||
| 84 | } | ||||||||||
| 85 | } | ||||||||||
| 86 | |||||||||||
| 87 | 9 | ▶ | return 1 if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 88 | } | ||||||||||
| 89 | |||||||||||
| 90 | 12 | ▶ | sub num_lt { | ||||||||
|
Subroutine
num_lt: called CC=6 SCAR=17.9
Pod
undocumented
| |||||||||||
| 91 | 12 | my ( $self, $test, $switch ) = @_; | |||||||||
| 92 | |||||||||||
| 93 | 12 | ▶ | return num_gt( $self, $test ) if $switch; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 94 | |||||||||||
| 95 | 8 | my $count = 0; | |||||||||
| 96 | |||||||||||
| 97 | 8 | for (@$self) { | |||||||||
| 98 | 21 | ▶ | if ( $_ < $test ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 99 | 8 | ▶ | return if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 100 | 6 | $count = 1; | |||||||||
| 101 | } | ||||||||||
| 102 | } | ||||||||||
| 103 | |||||||||||
| 104 | 6 | ▶ | return 1 if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 105 | } | ||||||||||
| 106 | |||||||||||
| 107 | 3 | ▶ | sub str_eq { | ||||||||
|
Subroutine
str_eq: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||
| 108 | 3 | my ( $self, $test ) = @_; | |||||||||
| 109 | 3 | my $count = 0; | |||||||||
| 110 | |||||||||||
| 111 | 3 | for (@$self) { | |||||||||
| 112 | 6 | ▶ | if ( $_ eq $test ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 113 | 3 | ▶ | return if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 114 | 2 | $count = 1; | |||||||||
| 115 | } | ||||||||||
| 116 | } | ||||||||||
| 117 | |||||||||||
| 118 | 2 | ▶ | return 1 if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 119 | } | ||||||||||
| 120 | |||||||||||
| 121 | 4 | ▶ | sub str_ne { | ||||||||
|
Subroutine
str_ne: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||
| 122 | 4 | my ( $self, $test ) = @_; | |||||||||
| 123 | 4 | my $count = 0; | |||||||||
| 124 | |||||||||||
| 125 | 4 | for (@$self) { | |||||||||
| 126 | 9 | ▶ | if ( $_ ne $test ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 127 | 4 | ▶ | return if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 128 | 3 | $count = 1; | |||||||||
| 129 | } | ||||||||||
| 130 | } | ||||||||||
| 131 | |||||||||||
| 132 | 3 | ▶ | return 1 if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 133 | } | ||||||||||
| 134 | |||||||||||
| 135 | 11 | ▶ | sub str_ge { | ||||||||
|
Subroutine
str_ge: called CC=6 SCAR=17.9
Pod
undocumented
| |||||||||||
| 136 | 11 | my ( $self, $test, $switch ) = @_; | |||||||||
| 137 | |||||||||||
| 138 | 11 | ▶ | return str_le( $self, $test ) if $switch; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 139 | |||||||||||
| 140 | 7 | my $count = 0; | |||||||||
| 141 | |||||||||||
| 142 | 7 | for (@$self) { | |||||||||
| 143 | 13 | ▶ | if ( $_ ge $test ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 144 | 7 | ▶ | return if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 145 | 5 | $count = 1; | |||||||||
| 146 | } | ||||||||||
| 147 | } | ||||||||||
| 148 | |||||||||||
| 149 | 5 | ▶ | return 1 if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 150 | } | ||||||||||
| 151 | |||||||||||
| 152 | 11 | ▶ | sub str_gt { | ||||||||
|
Subroutine
str_gt: called CC=6 SCAR=17.9
Pod
undocumented
| |||||||||||
| 153 | 11 | my ( $self, $test, $switch ) = @_; | |||||||||
| 154 | |||||||||||
| 155 | 11 | ▶ | return str_lt( $self, $test ) if $switch; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 156 | |||||||||||
| 157 | 7 | my $count = 0; | |||||||||
| 158 | |||||||||||
| 159 | 7 | for (@$self) { | |||||||||
| 160 | 14 | ▶ | if ( $_ gt $test ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 161 | 8 | ▶ | return if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 162 | 6 | $count = 1; | |||||||||
| 163 | } | ||||||||||
| 164 | } | ||||||||||
| 165 | |||||||||||
| 166 | 5 | ▶ | return 1 if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 167 | } | ||||||||||
| 168 | |||||||||||
| 169 | 10 | ▶ | sub str_le { | ||||||||
|
Subroutine
str_le: called CC=6 SCAR=17.9
Pod
undocumented
| |||||||||||
| 170 | 10 | my ( $self, $test, $switch ) = @_; | |||||||||
| 171 | |||||||||||
| 172 | 10 | ▶ | return str_ge( $self, $test ) if $switch; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 173 | |||||||||||
| 174 | 7 | my $count = 0; | |||||||||
| 175 | |||||||||||
| 176 | 7 | for (@$self) { | |||||||||
| 177 | 14 | ▶ | if ( $_ le $test ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 178 | 5 | ▶ | return if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 179 | 4 | $count = 1; | |||||||||
| 180 | } | ||||||||||
| 181 | } | ||||||||||
| 182 | |||||||||||
| 183 | 6 | ▶ | return 1 if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 184 | } | ||||||||||
| 185 | |||||||||||
| 186 | 12 | ▶ | sub str_lt { | ||||||||
|
Subroutine
str_lt: called CC=6 SCAR=17.9
Pod
undocumented
| |||||||||||
| 187 | 12 | my ( $self, $test, $switch ) = @_; | |||||||||
| 188 | |||||||||||
| 189 | 12 | ▶ | return str_gt( $self, $test ) if $switch; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 190 | |||||||||||
| 191 | 8 | my $count = 0; | |||||||||
| 192 | |||||||||||
| 193 | 8 | for (@$self) { | |||||||||
| 194 | 16 | ▶ | if ( $_ lt $test ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 195 | 8 | ▶ | return if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 196 | 6 | $count = 1; | |||||||||
| 197 | } | ||||||||||
| 198 | } | ||||||||||
| 199 | |||||||||||
| 200 | 6 | ▶ | return 1 if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 201 | } | ||||||||||
| 202 | |||||||||||
| 203 | 5 | ▶ | sub regex_eq { | ||||||||
|
Subroutine
regex_eq: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||
| 204 | 5 | my ( $self, $test, $switch ) = @_; | |||||||||
| 205 | |||||||||||
| 206 | 5 | my $count = 0; | |||||||||
| 207 | |||||||||||
| 208 | 5 | for (@$self) { | |||||||||
| 209 | 12 | ▶ | if ( $_ =~ $test ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 210 | 8 | ▶ | return if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 211 | 5 | $count = 1; | |||||||||
| 212 | } | ||||||||||
| 213 | } | ||||||||||
| 214 | |||||||||||
| 215 | 2 | ▶ | return 1 if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 216 | } | ||||||||||
| 217 | |||||||||||
| 218 | 4 | ▶ | sub regex_ne { | ||||||||
|
Subroutine
regex_ne: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||
| 219 | 4 | my ( $self, $test, $switch ) = @_; | |||||||||
| 220 | |||||||||||
| 221 | 4 | my $count = 0; | |||||||||
| 222 | |||||||||||
| 223 | 4 | for (@$self) { | |||||||||
| 224 | 11 | ▶ | if ( $_ !~ $test ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 225 | 4 | ▶ | return if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 226 | 3 | $count = 1; | |||||||||
| 227 | } | ||||||||||
| 228 | } | ||||||||||
| 229 | |||||||||||
| 230 | 3 | ▶ | return 1 if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 231 | } | ||||||||||
| 232 | |||||||||||
| 233 | 5 | ▶ | sub bool { | ||||||||
|
Subroutine
bool: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||
| 234 | 5 | my ($self) = @_; | |||||||||
| 235 | 5 | my $count = 0; | |||||||||
| 236 | |||||||||||
| 237 | 5 | for (@$self) { | |||||||||
| 238 | 11 | ▶ | if ($_) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 239 | 5 | ▶ | return if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 240 | 4 | $count = 1; | |||||||||
| 241 | } | ||||||||||
| 242 | } | ||||||||||
| 243 | |||||||||||
| 244 | 4 | ▶ | return 1 if $count; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 245 | } | ||||||||||
| 246 | |||||||||||
| 247 | 8 | 1; | |||||||||
| 248 | |||||||||||