line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::TokenStream::Types; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
62
|
use v5.12; |
|
4
|
|
|
|
|
20
|
|
4
|
4
|
|
|
4
|
|
22
|
use warnings; |
|
4
|
|
|
|
|
12
|
|
|
4
|
|
|
|
|
224
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
1902
|
use Type::Utils qw(as class_type coerce declare from role_type where via); |
|
4
|
|
|
|
|
103162
|
|
|
4
|
|
|
|
|
67
|
|
9
|
4
|
|
|
4
|
|
6988
|
use Types::Common::Numeric qw(PositiveOrZeroInt); |
|
4
|
|
|
|
|
221261
|
|
|
4
|
|
|
|
|
41
|
|
10
|
4
|
|
|
4
|
|
2419
|
use Types::Standard qw(ClassName Str RegexpRef); |
|
4
|
|
|
|
|
20
|
|
|
4
|
|
|
|
|
46
|
|
11
|
|
|
|
|
|
|
|
12
|
4
|
|
|
|
|
29
|
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
|
|
4046
|
); |
|
4
|
|
|
|
|
17
|
|
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__ |