| 1 | package Text::Xatena::Node::StopP; | ||||||||||
| 2 | |||||||||||
| 3 | 19 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 19 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 19 | ▶ | use base qw(Text::Xatena::Node); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 19 | ▶ | use constant { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 19 | BEGINNING => qr/^>(<.+>)(<)?$/, | |||||||||
| 8 | ENDOFNODE => qr/^(.+>)<$/, | ||||||||||
| 9 | 19 | }; | |||||||||
| 10 | |||||||||||
| 11 | 400 | ▶ | sub parse { | ||||||||
|
Subroutine
parse: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||
| 12 | 400 | my ($class, $s, $parent, $stack) = @_; | |||||||||
| 13 | 400 | ▶ | if ($s->scan(BEGINNING)) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | 7 | my $node = $class->new([ $s->matched->[1] ]); | |||||||||
| 15 | 7 | push @$parent, $node; | |||||||||
| 16 | 7 | ▶ | if (!$s->matched->[2]) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | 2 | push @$stack, $node; | |||||||||
| 18 | } | ||||||||||
| 19 | 7 | return 1; | |||||||||
| 20 | } | ||||||||||
| 21 | |||||||||||
| 22 | 393 | ▶ | if ($s->scan(ENDOFNODE)) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | 2 | my $node = pop @$stack; | |||||||||
| 24 | 2 | push @$node, $s->matched->[1]; | |||||||||
| 25 | 2 | ▶ | ref($node) eq $class or warn sprintf("syntax error: unmatched syntax got:%s expected:%s", ref($node), $class); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | 2 | return 1; | |||||||||
| 27 | } | ||||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 9 | ▶ | sub as_html { | ||||||||
|
Subroutine
as_html: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 31 | 9 | my ($self, $context, %opts) = @_; | |||||||||
| 32 | 9 | $self->SUPER::as_html($context, %opts, stopp => 1); | |||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 19 | 1; | |||||||||
| 36 | __END__ | ||||||||||