| 1 | package Parse::Highlife::Rule::Token; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use base qw(Parse::Highlife::Rule); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use Parse::Highlife::Utils qw(params); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use Data::Dump qw(dump); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | sub new | ||||||||||
| 9 | 0 | ▶ | { | ||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 10 | 0 | my( $class, @args ) = @_; | |||||||||
| 11 | 0 | my $self = bless Parse::Highlife::Rule->new( @args ), $class; | |||||||||
| 12 | 0 | return $self -> _init( @args ); | |||||||||
| 13 | } | ||||||||||
| 14 | |||||||||||
| 15 | sub _init | ||||||||||
| 16 | 0 | ▶ | { | ||||||||
|
Subroutine
_init: not called CC=1 SCAR=6.9
| |||||||||||
| 17 | 0 | my( $self, $token ) | |||||||||
| 18 | = params( \@_, | ||||||||||
| 19 | -token => '', | ||||||||||
| 20 | ); | ||||||||||
| 21 | 0 | $self->{'token'} = $token; | |||||||||
| 22 | 0 | return $self; | |||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | sub parse_from_token | ||||||||||
| 26 | 0 | ▶ | { | ||||||||
|
Subroutine
parse_from_token: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 27 | 0 | my( $self, $parser, $tokens, $t ) = @_; | |||||||||
| 28 | 0 | ▶ | return (0,0,0) if $t >= scalar(@{$tokens}); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | |||||||||||
| 30 | 0 | my $_t = $t; | |||||||||
| 31 | 0 | ($_t) = $self->_parse_ignored_tokens( $tokens, $_t ); | |||||||||
| 32 | 0 | my $token = $tokens->[$_t]; | |||||||||
| 33 | |||||||||||
| 34 | 0 | ▶ | if( $token->{'token-name'} eq $self->{'token'} ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 35 | return ( | ||||||||||
| 36 | 1, | ||||||||||
| 37 | $_t + 1, | ||||||||||
| 38 | 0 | $parser->make_ast_element('leaf', $self->{'name'}, $token->{'matched-substring'}) | |||||||||
| 39 | ); | ||||||||||
| 40 | } | ||||||||||
| 41 | 0 | return (0,0,0); | |||||||||
| 42 | } | ||||||||||
| 43 | |||||||||||
| 44 | 1 | 1; | |||||||||