line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Xatena::Node::StopP; |
2
|
|
|
|
|
|
|
|
3
|
17
|
|
|
17
|
|
83
|
use strict; |
|
17
|
|
|
|
|
32
|
|
|
17
|
|
|
|
|
530
|
|
4
|
17
|
|
|
17
|
|
86
|
use warnings; |
|
17
|
|
|
|
|
28
|
|
|
17
|
|
|
|
|
430
|
|
5
|
17
|
|
|
17
|
|
82
|
use base qw(Text::Xatena::Node); |
|
17
|
|
|
|
|
31
|
|
|
17
|
|
|
|
|
340
|
|
6
|
|
|
|
|
|
|
use constant { |
7
|
17
|
|
|
|
|
4787
|
BEGINNING => qr/^>(<.+>)(<)?$/, |
8
|
|
|
|
|
|
|
ENDOFNODE => qr/^(.+>)<$/, |
9
|
17
|
|
|
17
|
|
97
|
}; |
|
17
|
|
|
|
|
32
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub parse { |
12
|
359
|
|
|
359
|
0
|
2303
|
my ($class, $s, $parent, $stack) = @_; |
13
|
359
|
100
|
|
|
|
883
|
if ($s->scan(BEGINNING)) { |
14
|
7
|
|
|
|
|
30
|
my $node = $class->new([ $s->matched->[1] ]); |
15
|
7
|
|
|
|
|
270
|
push @$parent, $node; |
16
|
7
|
100
|
|
|
|
23
|
if (!$s->matched->[2]) { |
17
|
2
|
|
|
|
|
6
|
push @$stack, $node; |
18
|
|
|
|
|
|
|
} |
19
|
7
|
|
|
|
|
46
|
return 1; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
352
|
100
|
|
|
|
899
|
if ($s->scan(ENDOFNODE)) { |
23
|
2
|
|
|
|
|
7
|
my $node = pop @$stack; |
24
|
2
|
|
|
|
|
8
|
push @$node, $s->matched->[1]; |
25
|
2
|
50
|
|
|
|
11
|
ref($node) eq $class or warn sprintf("syntax error: unmatched syntax got:%s expected:%s", ref($node), $class); |
26
|
2
|
|
|
|
|
17
|
return 1; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub as_html { |
31
|
9
|
|
|
9
|
0
|
22
|
my ($self, $context, %opts) = @_; |
32
|
9
|
|
|
|
|
63
|
$self->SUPER::as_html($context, %opts, stopp => 1); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
__END__ |