| 1 | package Document::AST; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 0 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 4 | 0 | my $class = shift; | |||||||||||||||||||
| 5 | 0 | ▶ | my $self = bless { @_ }, ref($class) || $class; | ||||||||||||||||||
|
Condition0%0/3
ref $class || $class
MC/DC0%0/2
ref $class || $class
ref $class
$class
Truth table0%0/3
A || B
A= ref $classB= $class
| |||||||||||||||||||||
| 6 | } | ||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | 0 | ▶ | sub init { | ||||||||||||||||||
|
Subroutine
init: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 9 | 0 | my $self = shift; | |||||||||||||||||||
| 10 | 0 | die "You need to override Document::AST::insert"; | |||||||||||||||||||
| 11 | # $self->{output} = []; | ||||||||||||||||||||
| 12 | } | ||||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | 0 | ▶ | sub content { | ||||||||||||||||||
|
Subroutine
content: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 15 | 0 | my $self = shift; | |||||||||||||||||||
| 16 | 0 | return $self->{output}; | |||||||||||||||||||
| 17 | } | ||||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | 0 | ▶ | sub insert { | ||||||||||||||||||
|
Subroutine
insert: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 20 | 0 | my $self = shift; | |||||||||||||||||||
| 21 | 0 | my $ast = shift; | |||||||||||||||||||
| 22 | 0 | die "You need to override Document::AST::insert"; | |||||||||||||||||||
| 23 | # $self->{output} .= $ast->{output}; | ||||||||||||||||||||
| 24 | } | ||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | 0 | ▶ | sub begin_node { | ||||||||||||||||||
|
Subroutine
begin_node: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 27 | 0 | my $self = shift; | |||||||||||||||||||
| 28 | 0 | my $tag = shift; | |||||||||||||||||||
| 29 | 0 | die "You need to override Document::AST::begin_node"; | |||||||||||||||||||
| 30 | # $self->{output} .= "+$tag\n"; | ||||||||||||||||||||
| 31 | } | ||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | 0 | ▶ | sub end_node { | ||||||||||||||||||
|
Subroutine
end_node: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 34 | 0 | my $self = shift; | |||||||||||||||||||
| 35 | 0 | my $tag = shift; | |||||||||||||||||||
| 36 | 0 | die "You need to override Document::AST::end_node"; | |||||||||||||||||||
| 37 | # $self->{output} .= "-$tag\n"; | ||||||||||||||||||||
| 38 | } | ||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | 0 | ▶ | sub text_node { | ||||||||||||||||||
|
Subroutine
text_node: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 41 | 0 | my $self = shift; | |||||||||||||||||||
| 42 | 0 | my $text = shift; | |||||||||||||||||||
| 43 | 0 | die; | |||||||||||||||||||
| 44 | # $self->{output} .= " $text\n"; | ||||||||||||||||||||
| 45 | } | ||||||||||||||||||||
| 46 | |||||||||||||||||||||
| 47 | 1 | 1; | |||||||||||||||||||