| 1 | package Text::TokenStream::Role::Stream; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use v5.12; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use Moo::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | our $VERSION = '0.04'; | |||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use namespace::clean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 1 | 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 | 0 | ▶ | sub collect_all { | ||||||||
|
Subroutine
collect_all: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 23 | 0 | my ($self) = @_; | |||||||||
| 24 | |||||||||||
| 25 | 0 | my @ret; | |||||||||
| 26 | 0 | ▶ | while (my $tok = $self->next) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | 0 | push @ret, $tok; | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 0 | return @ret; | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | 1 | ▶ | sub collect_upto { | ||||||||
|
Subroutine
collect_upto: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 34 | 1 | my ($self, $target) = @_; | |||||||||
| 35 | |||||||||||
| 36 | 1 | my @ret; | |||||||||
| 37 | 1 | ▶ | while (my $tok = $self->peek) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 38 | 4 | ▶ | last if $tok->matches($target); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 39 | 3 | push @ret, $self->next; | |||||||||
| 40 | } | ||||||||||
| 41 | |||||||||||
| 42 | 1 | return @ret; | |||||||||
| 43 | } | ||||||||||
| 44 | |||||||||||
| 45 | 1 | 1; | |||||||||
| 46 | __END__ | ||||||||||