line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::TokenStream::Types; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
59
|
use v5.12; |
|
4
|
|
|
|
|
14
|
|
4
|
4
|
|
|
4
|
|
24
|
use warnings; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
206
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
1704
|
use Type::Utils qw(as class_type coerce declare from role_type where via); |
|
4
|
|
|
|
|
96757
|
|
|
4
|
|
|
|
|
40
|
|
9
|
4
|
|
|
4
|
|
6433
|
use Types::Common::Numeric qw(PositiveOrZeroInt); |
|
4
|
|
|
|
|
209801
|
|
|
4
|
|
|
|
|
36
|
|
10
|
4
|
|
|
4
|
|
1949
|
use Types::Standard qw(ClassName Str RegexpRef); |
|
4
|
|
|
|
|
12
|
|
|
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
|
|
3978
|
); |
|
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__ |