line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSV::Keyword::Draft4::Pattern; |
2
|
|
|
|
|
|
|
|
3
|
44
|
|
|
44
|
|
30991
|
use strict; |
|
44
|
|
|
|
|
74
|
|
|
44
|
|
|
|
|
1066
|
|
4
|
44
|
|
|
44
|
|
196
|
use warnings; |
|
44
|
|
|
|
|
66
|
|
|
44
|
|
|
|
|
1050
|
|
5
|
44
|
|
|
44
|
|
188
|
use parent qw(JSV::Keyword); |
|
44
|
|
|
|
|
68
|
|
|
44
|
|
|
|
|
219
|
|
6
|
|
|
|
|
|
|
|
7
|
44
|
|
|
44
|
|
2100
|
use JSV::Keyword qw(:constants); |
|
44
|
|
|
|
|
90
|
|
|
44
|
|
|
|
|
10155
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub instance_type() { INSTANCE_TYPE_STRING(); } |
10
|
|
|
|
|
|
|
sub keyword() { "pattern" } |
11
|
|
|
|
|
|
|
sub keyword_priority() { 10; } |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub validate { |
14
|
22
|
|
|
22
|
0
|
50
|
my ($class, $context, $schema, $instance) = @_; |
15
|
|
|
|
|
|
|
|
16
|
22
|
|
|
|
|
135
|
my $keyword_value = $class->keyword_value($schema); |
17
|
|
|
|
|
|
|
|
18
|
22
|
100
|
|
|
|
304
|
if ($instance !~ m/$keyword_value/) { |
19
|
10
|
|
|
|
|
42
|
$context->log_error("The instance doesn't match the pattern value"); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |