line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSV::Keyword::Draft4::Pattern; |
2
|
|
|
|
|
|
|
|
3
|
47
|
|
|
47
|
|
37465
|
use strict; |
|
47
|
|
|
|
|
99
|
|
|
47
|
|
|
|
|
1299
|
|
4
|
47
|
|
|
47
|
|
248
|
use warnings; |
|
47
|
|
|
|
|
83
|
|
|
47
|
|
|
|
|
1293
|
|
5
|
47
|
|
|
47
|
|
226
|
use parent qw(JSV::Keyword); |
|
47
|
|
|
|
|
86
|
|
|
47
|
|
|
|
|
283
|
|
6
|
|
|
|
|
|
|
|
7
|
47
|
|
|
47
|
|
2535
|
use JSV::Keyword qw(:constants); |
|
47
|
|
|
|
|
93
|
|
|
47
|
|
|
|
|
12011
|
|
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
|
43
|
my ($class, $context, $schema, $instance) = @_; |
15
|
|
|
|
|
|
|
|
16
|
22
|
|
|
|
|
85
|
my $keyword_value = $class->keyword_value($schema); |
17
|
|
|
|
|
|
|
|
18
|
22
|
100
|
|
|
|
325
|
if ($instance !~ m/$keyword_value/) { |
19
|
10
|
|
|
|
|
39
|
$context->log_error("The instance doesn't match the pattern value"); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |