line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::TokenStream::Role::Stream; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
9739
|
use v5.12; |
|
1
|
|
|
|
|
3
|
|
4
|
1
|
|
|
1
|
|
5
|
use Moo::Role; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
385
|
use namespace::clean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
requires qw( |
11
|
|
|
|
|
|
|
current_position |
12
|
|
|
|
|
|
|
err |
13
|
|
|
|
|
|
|
fill |
14
|
|
|
|
|
|
|
looking_at |
15
|
|
|
|
|
|
|
next |
16
|
|
|
|
|
|
|
next_of |
17
|
|
|
|
|
|
|
peek |
18
|
|
|
|
|
|
|
skip_optional |
19
|
|
|
|
|
|
|
token_err |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub collect_all { |
23
|
0
|
|
|
0
|
1
|
0
|
my ($self) = @_; |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
0
|
my @ret; |
26
|
0
|
|
|
|
|
0
|
while (my $tok = $self->next) { |
27
|
0
|
|
|
|
|
0
|
push @ret, $tok; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
0
|
return @ret; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub collect_upto { |
34
|
1
|
|
|
1
|
1
|
841
|
my ($self, $target) = @_; |
35
|
|
|
|
|
|
|
|
36
|
1
|
|
|
|
|
3
|
my @ret; |
37
|
1
|
|
|
|
|
4
|
while (my $tok = $self->peek) { |
38
|
4
|
100
|
|
|
|
14
|
last if $tok->matches($target); |
39
|
3
|
|
|
|
|
10
|
push @ret, $self->next; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
1
|
|
|
|
|
6
|
return @ret; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
__END__ |