line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::TokenStream::Types; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
57
|
use v5.12; |
|
4
|
|
|
|
|
16
|
|
4
|
4
|
|
|
4
|
|
21
|
use warnings; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
190
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
1669
|
use Type::Utils qw(as class_type coerce declare from role_type where via); |
|
4
|
|
|
|
|
96897
|
|
|
4
|
|
|
|
|
37
|
|
9
|
4
|
|
|
4
|
|
6555
|
use Types::Common::Numeric qw(PositiveOrZeroInt); |
|
4
|
|
|
|
|
208840
|
|
|
4
|
|
|
|
|
36
|
|
10
|
4
|
|
|
4
|
|
1975
|
use Types::Standard qw(ClassName Str RegexpRef); |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
28
|
|
11
|
|
|
|
|
|
|
|
12
|
4
|
|
|
|
|
19
|
use Type::Library -base, -declare => qw( |
13
|
|
|
|
|
|
|
Identifier |
14
|
|
|
|
|
|
|
Lexer |
15
|
|
|
|
|
|
|
LexerRule |
16
|
|
|
|
|
|
|
Position |
17
|
|
|
|
|
|
|
Stream |
18
|
|
|
|
|
|
|
Token |
19
|
|
|
|
|
|
|
TokenClass |
20
|
|
|
|
|
|
|
TokenStream |
21
|
4
|
|
|
4
|
|
3858
|
); |
|
4
|
|
|
|
|
9
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
declare Identifier, as Str, where { /^ (?![0-9]) [0-9a-zA-Z_]+ \z/x }; |
24
|
|
|
|
|
|
|
declare Position, as PositiveOrZeroInt; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
declare TokenClass, as ClassName, |
27
|
|
|
|
|
|
|
where { $_->isa('Text::TokenStream::Token') }; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
declare LexerRule, as RegexpRef|Str; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
role_type Stream, { role => 'Text::TokenStream::Role::Stream' }; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
class_type Lexer, { class => 'Text::TokenStream::Lexer' }; |
34
|
|
|
|
|
|
|
class_type Token, { class => 'Text::TokenStream::Token' }; |
35
|
|
|
|
|
|
|
class_type TokenStream, { class => 'Text::TokenStream' }; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
__END__ |