line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSV::Keyword::Draft4::Pattern; |
2
|
|
|
|
|
|
|
|
3
|
47
|
|
|
47
|
|
22050
|
use strict; |
|
47
|
|
|
|
|
56
|
|
|
47
|
|
|
|
|
1122
|
|
4
|
47
|
|
|
47
|
|
138
|
use warnings; |
|
47
|
|
|
|
|
49
|
|
|
47
|
|
|
|
|
932
|
|
5
|
47
|
|
|
47
|
|
129
|
use parent qw(JSV::Keyword); |
|
47
|
|
|
|
|
45
|
|
|
47
|
|
|
|
|
174
|
|
6
|
|
|
|
|
|
|
|
7
|
47
|
|
|
47
|
|
1981
|
use JSV::Keyword qw(:constants); |
|
47
|
|
|
|
|
46
|
|
|
47
|
|
|
|
|
8123
|
|
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
|
25
|
my ($class, $context, $schema, $instance) = @_; |
15
|
|
|
|
|
|
|
|
16
|
22
|
|
|
|
|
47
|
my $keyword_value = $class->keyword_value($schema); |
17
|
|
|
|
|
|
|
|
18
|
22
|
100
|
|
|
|
267
|
if ($instance !~ m/$keyword_value/) { |
19
|
10
|
|
|
|
|
21
|
$context->log_error("The instance doesn't match the pattern value"); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |