TokenStream/Types.pm

filter: Statementstmt 100% 29 / 29 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod n/a totaltotal 100% 37 / 37 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« TokenStream/Token.pm ↑ Summary
1 package Text::TokenStream::Types;
2  
3 4 ▶use v5.12;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 4 our $VERSION = '0.04';
7  
8 4 ▶use Type::Utils qw(as class_type coerce declare from role_type where via);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 4 ▶use Types::Common::Numeric qw(PositiveOrZeroInt);
Subroutine BEGIN: called CC=1 SCAR=0.0
10 4 ▶use Types::Standard qw(ClassName Str RegexpRef);
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 4 ▶use Type::Library -base, -declare => qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
13 Identifier
14 Lexer
15 LexerRule
16 Position
17 Stream
18 Token
19 TokenClass
20 TokenStream
21 4 );
22  
23 45 ▶declare Identifier, as Str, where { /^ (?![0-9]) [0-9a-zA-Z_]+ \z/x };
Subroutine __ANON__: called CC=1 SCAR=0.0
24 4 declare Position, as PositiveOrZeroInt;
25  
26 declare TokenClass, as ClassName,
27 2 ▶ where { $_->isa('Text::TokenStream::Token') };
Subroutine __ANON__: called CC=1 SCAR=0.0
28  
29 4 declare LexerRule, as RegexpRef|Str;
30  
31 4 role_type Stream, { role => 'Text::TokenStream::Role::Stream' };
32  
33 4 class_type Lexer, { class => 'Text::TokenStream::Lexer' };
34 4 class_type Token, { class => 'Text::TokenStream::Token' };
35 4 class_type TokenStream, { class => 'Text::TokenStream' };
36  
37 4 1;
38 __END__
« TokenStream/Token.pm ↑ Summary