line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::TokenStream::Role::Stream; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
9903
|
use v5.12; |
|
1
|
|
|
|
|
4
|
|
4
|
1
|
|
|
1
|
|
6
|
use Moo::Role; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
402
|
use namespace::clean; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
9
|
|
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
|
854
|
my ($self, $target) = @_; |
35
|
|
|
|
|
|
|
|
36
|
1
|
|
|
|
|
3
|
my @ret; |
37
|
1
|
|
|
|
|
5
|
while (my $tok = $self->peek) { |
38
|
4
|
100
|
|
|
|
15
|
last if $tok->matches($target); |
39
|
3
|
|
|
|
|
11
|
push @ret, $self->next; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
1
|
|
|
|
|
6
|
return @ret; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
__END__ |