line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use strict; |
3
|
12
|
|
|
12
|
|
66
|
use warnings; |
|
12
|
|
|
|
|
21
|
|
|
12
|
|
|
|
|
275
|
|
4
|
12
|
|
|
12
|
|
67
|
|
|
12
|
|
|
|
|
24
|
|
|
12
|
|
|
|
|
405
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.48'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use parent 'Specio::Exporter'; |
8
|
12
|
|
|
12
|
|
53
|
|
|
12
|
|
|
|
|
33
|
|
|
12
|
|
|
|
|
45
|
|
9
|
|
|
|
|
|
|
use Specio::Declare; |
10
|
12
|
|
|
12
|
|
713
|
use Specio::Library::Builtins; |
|
12
|
|
|
|
|
23
|
|
|
12
|
|
|
|
|
77
|
|
11
|
12
|
|
|
12
|
|
63
|
|
|
12
|
|
|
|
|
29
|
|
|
12
|
|
|
|
|
74
|
|
12
|
|
|
|
|
|
|
declare( |
13
|
|
|
|
|
|
|
'NonEmptySimpleStr', |
14
|
|
|
|
|
|
|
parent => t('Str'), |
15
|
|
|
|
|
|
|
inline => sub { |
16
|
|
|
|
|
|
|
return |
17
|
|
|
|
|
|
|
sprintf( |
18
|
|
|
|
|
|
|
<<'EOF', $_[0]->parent->inline_check( $_[1] ), ( $_[1] ) x 3 ); |
19
|
|
|
|
|
|
|
( |
20
|
|
|
|
|
|
|
%s |
21
|
|
|
|
|
|
|
&& |
22
|
|
|
|
|
|
|
length %s > 0 |
23
|
|
|
|
|
|
|
&& |
24
|
|
|
|
|
|
|
length %s <= 255 |
25
|
|
|
|
|
|
|
&& |
26
|
|
|
|
|
|
|
%s !~ /[\n\r\x{2028}\x{2029}]/ |
27
|
|
|
|
|
|
|
) |
28
|
|
|
|
|
|
|
EOF |
29
|
|
|
|
|
|
|
}, |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
declare( |
33
|
|
|
|
|
|
|
'NonEmptyStr', |
34
|
|
|
|
|
|
|
parent => t('Str'), |
35
|
|
|
|
|
|
|
inline => sub { |
36
|
|
|
|
|
|
|
return |
37
|
|
|
|
|
|
|
sprintf( <<'EOF', $_[0]->parent->inline_check( $_[1] ), $_[1] ); |
38
|
|
|
|
|
|
|
( |
39
|
|
|
|
|
|
|
%s |
40
|
|
|
|
|
|
|
&& |
41
|
|
|
|
|
|
|
length %s |
42
|
|
|
|
|
|
|
) |
43
|
|
|
|
|
|
|
EOF |
44
|
|
|
|
|
|
|
}, |
45
|
|
|
|
|
|
|
); |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
declare( |
48
|
|
|
|
|
|
|
'SimpleStr', |
49
|
|
|
|
|
|
|
parent => t('Str'), |
50
|
|
|
|
|
|
|
inline => sub { |
51
|
|
|
|
|
|
|
return |
52
|
|
|
|
|
|
|
sprintf( |
53
|
|
|
|
|
|
|
<<'EOF', $_[0]->parent->inline_check( $_[1] ), ( $_[1] ) x 2 ); |
54
|
|
|
|
|
|
|
( |
55
|
|
|
|
|
|
|
%s |
56
|
|
|
|
|
|
|
&& |
57
|
|
|
|
|
|
|
length %s <= 255 |
58
|
|
|
|
|
|
|
&& |
59
|
|
|
|
|
|
|
%s !~ /[\n\r\x{2028}\x{2029}]/ |
60
|
|
|
|
|
|
|
) |
61
|
|
|
|
|
|
|
EOF |
62
|
|
|
|
|
|
|
}, |
63
|
|
|
|
|
|
|
); |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
# ABSTRACT: Implements type constraint objects for some common string types |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=pod |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=encoding UTF-8 |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 NAME |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Specio::Library::String - Implements type constraint objects for some common string types |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 VERSION |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
version 0.48 |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 DESCRIPTION |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
This library provides some additional string types for common cases. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head2 NonEmptyStr |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
A string which has at least one character. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head2 SimpleStr |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
A string that is 255 characters or less with no vertical whitespace characters. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head2 NonEmptySimpleStr |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
A non-empty string that is 255 characters or less with no vertical whitespace |
97
|
|
|
|
|
|
|
characters. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head1 SUPPORT |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
Bugs may be submitted at L<https://github.com/houseabsolute/Specio/issues>. |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 SOURCE |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
The source code repository for Specio can be found at L<https://github.com/houseabsolute/Specio>. |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 AUTHOR |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
Dave Rolsky <autarch@urth.org> |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
This software is Copyright (c) 2012 - 2022 by Dave Rolsky. |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
This is free software, licensed under: |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
The Artistic License 2.0 (GPL Compatible) |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
The full text of the license can be found in the |
120
|
|
|
|
|
|
|
F<LICENSE> file included with this distribution. |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=cut |