| 1 | # This code is part of Perl distribution OODoc version 3.05. | ||||||||||||||||||||||||||||||
| 2 | # The POD got stripped from this file by OODoc version 3.05. | ||||||||||||||||||||||||||||||
| 3 | # For contributors see file ChangeLog. | ||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||
| 5 | # This software is copyright (c) 2003-2025 by Mark Overmeer. | ||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||
| 7 | # This is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||||||||||||
| 8 | # the same terms as the Perl 5 programming language system itself. | ||||||||||||||||||||||||||||||
| 9 | # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later | ||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||
| 13 | package OODoc::Format::Pod;{ | ||||||||||||||||||||||||||||||
| 14 | 2 | our $VERSION = '3.05'; | |||||||||||||||||||||||||||||
| 15 | } | ||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||
| 17 | 2 | ▶ | use parent 'OODoc::Format'; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||
| 19 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 20 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 21 | 2 | ▶ | use utf8; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||
| 23 | 2 | ▶ | use Log::Report 'oodoc'; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||
| 25 | 2 | ▶ | use File::Spec::Functions qw/catfile/; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 26 | 2 | ▶ | use List::Util qw/max/; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 27 | 2 | ▶ | use Pod::Escapes qw/e2char/; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||
| 29 | #-------------------- | ||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||
| 31 | sub init($) | ||||||||||||||||||||||||||||||
| 32 | 0 | ▶ | { my ($self, $args) = @_; | ||||||||||||||||||||||||||||
|
Subroutine
init: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||
| 33 | 0 | ▶ | $args->{format} //= 'pod'; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$args->{"format"} //= "pod"
MC/DC0%0/1
$args->{"format"} //= "pod"
$args->{"format"}
Truth table0%0/2
A
A= $args->{"format"}
| |||||||||||||||||||||||||||||||
| 34 | 0 | $self->SUPER::init($args); | |||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||
| 37 | #-------------------- | ||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||
| 39 | sub cleanup($$%) | ||||||||||||||||||||||||||||||
| 40 | 0 | ▶ | { my ($self, $manual, $string, %args) = @_; | ||||||||||||||||||||||||||||
|
Subroutine
cleanup: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||
| 41 | $manual->parser->cleanupPod($manual, $string, %args, | ||||||||||||||||||||||||||||||
| 42 | 0 | ▶ | create_link => sub { $self->link(@_) }, | ||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||
| 43 | 0 | ); | |||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||
| 47 | sub link($$;$$) | ||||||||||||||||||||||||||||||
| 48 | 0 | ▶ | { my ($any, $manual, $object, $text) = @_; | ||||||||||||||||||||||||||||
|
Subroutine
link: not called CC=9 SCAR=45.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||
| 50 | 0 | ▶ | $object = $object->subroutine if $object->isa('OODoc::Text::Option'); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 51 | 0 | ▶ | $object = $object->subroutine if $object->isa('OODoc::Text::Default'); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 52 | 0 | ▶ | $object = $object->container if $object->isa('OODoc::Text::Example'); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 53 | 0 | ▶ | $object = $object->container if $object->isa('OODoc::Text::Subroutine'); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 54 | 0 | ▶ | $text = defined $text ? "$text|" : ''; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||
| 56 | 0 | ▶ | return "L<$text$object>" | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 57 | if $object->isa('OODoc::Manual'); | ||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||
| 59 | 0 | ▶ | $object->isa('OODoc::Text::Structure') | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 60 | or error __x"cannot link to a {package}", package => ref $object; | ||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||
| 62 | 0 | ▶ | my $manlink = defined $manual ? $object->manual.'/' : ''; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 63 | 0 | qq(L<$text$manlink"$object">); | |||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||
| 67 | sub createManual($@) | ||||||||||||||||||||||||||||||
| 68 | 0 | ▶ | { my ($self, %args) = @_; | ||||||||||||||||||||||||||||
|
Subroutine
createManual: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||
| 69 | 0 | ▶ | my $manual = $args{manual} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 70 | 0 | my $podname = $manual->source =~ s/\.pm$/.pod/r; | |||||||||||||||||||||||||||||
| 71 | 0 | my $tmpname = $podname . 't'; | |||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||
| 73 | 0 | my $tmpfile = catfile $self->workdir, $tmpname; | |||||||||||||||||||||||||||||
| 74 | 0 | my $podfile = catfile $self->workdir, $podname; | |||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||
| 76 | 0 | ▶ | open my $output, '>:encoding(UTF-8)', $tmpfile | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 77 | or fault __x"cannot write prelimary pod manual to {file}", file => $tmpfile; | ||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||
| 79 | $self->_formatManual( | ||||||||||||||||||||||||||||||
| 80 | manual => $manual, | ||||||||||||||||||||||||||||||
| 81 | output => $output, | ||||||||||||||||||||||||||||||
| 82 | append => $args{append}, | ||||||||||||||||||||||||||||||
| 83 | 0 | %args | |||||||||||||||||||||||||||||
| 84 | ); | ||||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||||
| 86 | 0 | $output->close; | |||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||
| 88 | 0 | $self->simplifyPod($tmpfile, $podfile); | |||||||||||||||||||||||||||||
| 89 | 0 | unlink $tmpfile; | |||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||||
| 91 | 0 | $self->manifest->add($podfile); | |||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||
| 93 | 0 | $self; | |||||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||
| 96 | sub _formatManual(@) | ||||||||||||||||||||||||||||||
| 97 | 0 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||||
|
Subroutine
_formatManual: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||
| 98 | 0 | $self->chapterName(@_); | |||||||||||||||||||||||||||||
| 99 | 0 | $self->chapterInheritance(@_); | |||||||||||||||||||||||||||||
| 100 | 0 | $self->chapterSynopsis(@_); | |||||||||||||||||||||||||||||
| 101 | 0 | $self->chapterDescription(@_); | |||||||||||||||||||||||||||||
| 102 | 0 | $self->chapterOverloaded(@_); | |||||||||||||||||||||||||||||
| 103 | 0 | $self->chapterMethods(@_); | |||||||||||||||||||||||||||||
| 104 | 0 | $self->chapterExports(@_); | |||||||||||||||||||||||||||||
| 105 | 0 | $self->chapterDetails(@_); | |||||||||||||||||||||||||||||
| 106 | 0 | $self->chapterDiagnostics(@_); | |||||||||||||||||||||||||||||
| 107 | 0 | $self->chapterReferences(@_); | |||||||||||||||||||||||||||||
| 108 | 0 | $self->chapterCopyrights(@_); | |||||||||||||||||||||||||||||
| 109 | 0 | $self->showAppend(@_); | |||||||||||||||||||||||||||||
| 110 | 0 | $self; | |||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||
| 113 | sub showAppend(@) | ||||||||||||||||||||||||||||||
| 114 | 0 | ▶ | { my ($self, %args) = @_; | ||||||||||||||||||||||||||||
|
Subroutine
showAppend: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||||
| 115 | 0 | my $append = $args{append}; | |||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||
| 117 | 0 | ▶ | if(!defined $append) { ; } | ||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||
| 118 | 0 | elsif(ref $append eq 'CODE') { $append->(formatter => $self, %args) } | |||||||||||||||||||||||||||||
| 119 | else | ||||||||||||||||||||||||||||||
| 120 | 0 | ▶ | { my $output = $args{output} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 121 | 0 | $output->print($append); | |||||||||||||||||||||||||||||
| 122 | } | ||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||
| 124 | 0 | $self; | |||||||||||||||||||||||||||||
| 125 | } | ||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||
| 127 | sub showStructureExpanded(@) | ||||||||||||||||||||||||||||||
| 128 | 0 | ▶ | { my ($self, %args) = @_; | ||||||||||||||||||||||||||||
|
Subroutine
showStructureExpanded: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||
| 130 | 0 | ▶ | my $examples = $args{show_examples} || 'EXPAND'; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$args{'show_examples'} || 'EXPAND'
MC/DC0%0/1
$args{'show_examples'} || 'EXPAND'
$args{'show_examples'}
Truth table0%0/2
A
A= $args{'show_examples'}
| |||||||||||||||||||||||||||||||
| 131 | 0 | ▶ | my $text = $args{structure} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||||
| 133 | 0 | my $name = $text->name; | |||||||||||||||||||||||||||||
| 134 | 0 | my $level = $text->level; | |||||||||||||||||||||||||||||
| 135 | 0 | ▶ | my $output = $args{output} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 136 | 0 | ▶ | my $manual = $args{manual} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||
| 138 | 0 | my $descr = $self->cleanup($manual, $text->description); | |||||||||||||||||||||||||||||
| 139 | 0 | $output->print("\n=head$level $name\n\n$descr"); | |||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||||
| 141 | 0 | $self->showSubroutines(%args, subroutines => [ $text->subroutines ]); | |||||||||||||||||||||||||||||
| 142 | 0 | ▶ | $self->showExamples(%args, examples => [ $text->examples ]) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 143 | if $examples eq 'EXPAND'; | ||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||
| 145 | 0 | $self; | |||||||||||||||||||||||||||||
| 146 | } | ||||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||||
| 148 | sub showStructureRefer(@) | ||||||||||||||||||||||||||||||
| 149 | 0 | ▶ | { my ($self, %args) = @_; | ||||||||||||||||||||||||||||
|
Subroutine
showStructureRefer: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 150 | 0 | ▶ | my $text = $args{structure} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||||
| 152 | 0 | my $name = $text->name; | |||||||||||||||||||||||||||||
| 153 | 0 | my $level = $text->level; | |||||||||||||||||||||||||||||
| 154 | 0 | ▶ | my $output = $args{output} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 155 | 0 | ▶ | my $manual = $args{manual} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||
| 157 | 0 | my $link = $self->link($manual, $text); | |||||||||||||||||||||||||||||
| 158 | 0 | $output->print("\n=head$level $name\n\nSee $link.\n"); | |||||||||||||||||||||||||||||
| 159 | 0 | $self; | |||||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||||
| 162 | sub chapterDescription(@) | ||||||||||||||||||||||||||||||
| 163 | 0 | ▶ | { my ($self, %args) = @_; | ||||||||||||||||||||||||||||
|
Subroutine
chapterDescription: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||||
| 165 | 0 | $self->showRequiredChapter(DESCRIPTION => %args); | |||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||||
| 167 | 0 | ▶ | my $manual = $args{manual} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 168 | 0 | ▶ | my $details = $manual->chapter('DETAILS') // return $self; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$manual->chapter("DETAILS") // (return $self)
MC/DC0%0/1
$manual->chapter("DETAILS") // (return $self)
$manual->chapter("DETAILS")
Truth table0%0/2
A
A= $manual->chapter("DETAILS")
| |||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||
| 170 | 0 | ▶ | my $output = $args{output} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 171 | 0 | $output->print("\nSee L</DETAILS> chapter below\n"); | |||||||||||||||||||||||||||||
| 172 | 0 | $self->showChapterIndex($output, $details, " "); | |||||||||||||||||||||||||||||
| 173 | 0 | $self; | |||||||||||||||||||||||||||||
| 174 | } | ||||||||||||||||||||||||||||||
| 175 | |||||||||||||||||||||||||||||||
| 176 | sub chapterDiagnostics(@) | ||||||||||||||||||||||||||||||
| 177 | 0 | ▶ | { my ($self, %args) = @_; | ||||||||||||||||||||||||||||
|
Subroutine
chapterDiagnostics: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||||
| 178 | 0 | ▶ | my $manual = $args{manual} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||||
| 180 | 0 | my $diags = $manual->chapter('DIAGNOSTICS'); | |||||||||||||||||||||||||||||
| 181 | 0 | ▶ | $self->showChapter(chapter => $diags, %args) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 182 | if defined $diags; | ||||||||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||||||
| 184 | 0 | my @diags = map $_->diagnostics, $manual->subroutines; | |||||||||||||||||||||||||||||
| 185 | 0 | ▶ | return unless @diags; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||
| 187 | 0 | ▶ | my $output = $args{output} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 188 | 0 | ▶ | $diags | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 189 | or $output->print("\n=head1 DIAGNOSTICS\n"); | ||||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||||
| 191 | 0 | $output->print("\n=over 4\n\n"); | |||||||||||||||||||||||||||||
| 192 | 0 | $self->showDiagnostics(%args, diagnostics => \@diags); | |||||||||||||||||||||||||||||
| 193 | 0 | $output->print("\n=back\n\n"); | |||||||||||||||||||||||||||||
| 194 | 0 | $self; | |||||||||||||||||||||||||||||
| 195 | } | ||||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||||
| 198 | sub showChapterIndex($$;$) | ||||||||||||||||||||||||||||||
| 199 | 0 | ▶ | { my ($self, $output, $chapter, $indent) = @_; | ||||||||||||||||||||||||||||
|
Subroutine
showChapterIndex: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 200 | 0 | ▶ | $indent //= ''; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$indent //= ""
MC/DC0%0/1
$indent //= ""
$indent
Truth table0%0/2
A
A= $indent
| |||||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||||
| 202 | 0 | foreach my $section ($chapter->sections) | |||||||||||||||||||||||||||||
| 203 | 0 | { $output->print($indent, $section->name, "\n"); | |||||||||||||||||||||||||||||
| 204 | 0 | foreach my $subsection ($section->subsections) | |||||||||||||||||||||||||||||
| 205 | 0 | { $output->print($indent, $indent, $subsection->name, "\n"); | |||||||||||||||||||||||||||||
| 206 | } | ||||||||||||||||||||||||||||||
| 207 | } | ||||||||||||||||||||||||||||||
| 208 | 0 | $self; | |||||||||||||||||||||||||||||
| 209 | } | ||||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||||
| 211 | sub showExamples(@) | ||||||||||||||||||||||||||||||
| 212 | 0 | ▶ | { my ($self, %args) = @_; | ||||||||||||||||||||||||||||
|
Subroutine
showExamples: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||||
| 213 | 0 | ▶ | my $examples = $args{examples} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 214 | 0 | ▶ | @$examples or return; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||||
| 216 | 0 | ▶ | my $manual = $args{manual} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 217 | 0 | ▶ | my $output = $args{output} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||||
| 219 | 0 | foreach my $example (@$examples) | |||||||||||||||||||||||||||||
| 220 | 0 | { my $name = $self->cleanup($manual, $example->name); | |||||||||||||||||||||||||||||
| 221 | 0 | $output->print("\n» example: $name\n\n"); | |||||||||||||||||||||||||||||
| 222 | 0 | $output->print($self->cleanup($manual, $example->description)); | |||||||||||||||||||||||||||||
| 223 | 0 | $output->print("\n"); | |||||||||||||||||||||||||||||
| 224 | } | ||||||||||||||||||||||||||||||
| 225 | 0 | $self; | |||||||||||||||||||||||||||||
| 226 | } | ||||||||||||||||||||||||||||||
| 227 | |||||||||||||||||||||||||||||||
| 228 | sub showDiagnostics(@) | ||||||||||||||||||||||||||||||
| 229 | 0 | ▶ | { my ($self, %args) = @_; | ||||||||||||||||||||||||||||
|
Subroutine
showDiagnostics: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||||
| 230 | 0 | ▶ | my $diagnostics = $args{diagnostics} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 231 | 0 | ▶ | @$diagnostics or return; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 232 | |||||||||||||||||||||||||||||||
| 233 | 0 | ▶ | my $manual = $args{manual} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 234 | 0 | ▶ | my $output = $args{output} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 235 | |||||||||||||||||||||||||||||||
| 236 | 0 | foreach my $diag (sort @$diagnostics) | |||||||||||||||||||||||||||||
| 237 | 0 | { my $name = $self->cleanup($manual, $diag->name); | |||||||||||||||||||||||||||||
| 238 | 0 | my $type = $diag->type; | |||||||||||||||||||||||||||||
| 239 | 0 | $output->print("\n=item $type: $name\n\n"); | |||||||||||||||||||||||||||||
| 240 | 0 | $output->print($self->cleanup($manual, $diag->description)); | |||||||||||||||||||||||||||||
| 241 | 0 | $output->print("Cast by C<", $diag->subroutine->name, "()>\n"); | |||||||||||||||||||||||||||||
| 242 | 0 | $output->print("\n"); | |||||||||||||||||||||||||||||
| 243 | } | ||||||||||||||||||||||||||||||
| 244 | 0 | $self; | |||||||||||||||||||||||||||||
| 245 | } | ||||||||||||||||||||||||||||||
| 246 | |||||||||||||||||||||||||||||||
| 247 | sub showSubroutines(@) | ||||||||||||||||||||||||||||||
| 248 | 0 | ▶ | { my ($self, %args) = @_; | ||||||||||||||||||||||||||||
|
Subroutine
showSubroutines: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 249 | 0 | ▶ | my $subs = $args{subroutines} || []; | ||||||||||||||||||||||||||||
|
Condition0%0/2
$args{'subroutines'} || []
MC/DC0%0/1
$args{'subroutines'} || []
$args{'subroutines'}
Truth table0%0/2
A
A= $args{'subroutines'}
| |||||||||||||||||||||||||||||||
| 250 | 0 | ▶ | @$subs or return; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 251 | |||||||||||||||||||||||||||||||
| 252 | 0 | ▶ | my $output = $args{output} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 253 | |||||||||||||||||||||||||||||||
| 254 | 0 | $output->print("\n=over 4\n\n"); | |||||||||||||||||||||||||||||
| 255 | 0 | $self->SUPER::showSubroutines(%args); | |||||||||||||||||||||||||||||
| 256 | 0 | $output->print("\n=back\n\n"); | |||||||||||||||||||||||||||||
| 257 | } | ||||||||||||||||||||||||||||||
| 258 | |||||||||||||||||||||||||||||||
| 259 | sub showSubroutine(@) | ||||||||||||||||||||||||||||||
| 260 | 0 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||||
|
Subroutine
showSubroutine: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||
| 261 | 0 | $self->SUPER::showSubroutine(@_); | |||||||||||||||||||||||||||||
| 262 | |||||||||||||||||||||||||||||||
| 263 | 0 | my %args = @_; | |||||||||||||||||||||||||||||
| 264 | 0 | ▶ | my $output = $args{output} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 265 | 0 | $output->print("\n"); | |||||||||||||||||||||||||||||
| 266 | 0 | $self; | |||||||||||||||||||||||||||||
| 267 | } | ||||||||||||||||||||||||||||||
| 268 | |||||||||||||||||||||||||||||||
| 269 | sub showSubroutineUse(@) | ||||||||||||||||||||||||||||||
| 270 | 0 | ▶ | { my ($self, %args) = @_; | ||||||||||||||||||||||||||||
|
Subroutine
showSubroutineUse: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 271 | 0 | ▶ | my $subroutine = $args{subroutine} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 272 | 0 | ▶ | my $manual = $args{manual} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 273 | 0 | ▶ | my $output = $args{output} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 274 | |||||||||||||||||||||||||||||||
| 275 | 0 | my $use = $self->subroutineUse($manual, $subroutine); | |||||||||||||||||||||||||||||
| 276 | 0 | $use =~ s/(.+)/=item $1\n\n/gm; | |||||||||||||||||||||||||||||
| 277 | |||||||||||||||||||||||||||||||
| 278 | 0 | $output->print($use); | |||||||||||||||||||||||||||||
| 279 | 0 | ▶ | $output->print("Inherited, see ". $self->link($manual, $subroutine)."\n\n") | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 280 | if $manual->inherited($subroutine); | ||||||||||||||||||||||||||||||
| 281 | |||||||||||||||||||||||||||||||
| 282 | 0 | $self; | |||||||||||||||||||||||||||||
| 283 | } | ||||||||||||||||||||||||||||||
| 284 | |||||||||||||||||||||||||||||||
| 285 | sub subroutineUse($$) | ||||||||||||||||||||||||||||||
| 286 | 0 | ▶ | { my ($self, $manual, $subroutine) = @_; | ||||||||||||||||||||||||||||
|
Subroutine
subroutineUse: not called CC=9 SCAR=45.0
Pod
undocumented
| |||||||||||||||||||||||||||||||
| 287 | 0 | my $type = $subroutine->type; | |||||||||||||||||||||||||||||
| 288 | 0 | my $name = $self->cleanup($manual, $subroutine->name); | |||||||||||||||||||||||||||||
| 289 | 0 | my $paramlist = $self->cleanup($manual, $subroutine->parameters); | |||||||||||||||||||||||||||||
| 290 | |||||||||||||||||||||||||||||||
| 291 | 0 | ▶ | $type eq 'tie' | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 292 | and return qq[tie B<$name>, $paramlist]; | ||||||||||||||||||||||||||||||
| 293 | |||||||||||||||||||||||||||||||
| 294 | 0 | ▶ | my $params = !length $paramlist ? '()' : | ||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||
| 295 | $paramlist =~ m/^[\[<]|[\]>]$/ ? "( $paramlist )" : "($paramlist)"; | ||||||||||||||||||||||||||||||
| 296 | |||||||||||||||||||||||||||||||
| 297 | 0 | my $class = $manual->package; | |||||||||||||||||||||||||||||
| 298 | 0 | ▶ | my $use | ||||||||||||||||||||||||||||
|
Branch: 5 branches
| |||||||||||||||||||||||||||||||
| 299 | = $type eq 'i_method' ? qq[\$obj-E<gt>B<$name>$params] | ||||||||||||||||||||||||||||||
| 300 | : $type eq 'c_method' ? qq[\$class-E<gt>B<$name>$params] | ||||||||||||||||||||||||||||||
| 301 | : $type eq 'ci_method'? qq[\$any-E<gt>B<$name>$params] | ||||||||||||||||||||||||||||||
| 302 | : $type eq 'function' ? qq[B<$name>$params] | ||||||||||||||||||||||||||||||
| 303 | : $type eq 'overload' ? qq[overload: B<$name> $paramlist] | ||||||||||||||||||||||||||||||
| 304 | : panic $type; | ||||||||||||||||||||||||||||||
| 305 | |||||||||||||||||||||||||||||||
| 306 | 0 | $use; | |||||||||||||||||||||||||||||
| 307 | } | ||||||||||||||||||||||||||||||
| 308 | |||||||||||||||||||||||||||||||
| 309 | sub showSubroutineName(@) | ||||||||||||||||||||||||||||||
| 310 | 0 | ▶ | { my ($self, %args) = @_; | ||||||||||||||||||||||||||||
|
Subroutine
showSubroutineName: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||||
| 311 | 0 | ▶ | my $subroutine = $args{subroutine} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 312 | 0 | ▶ | my $manual = $args{manual} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 313 | 0 | ▶ | my $output = $args{output} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 314 | 0 | my $name = $subroutine->name; | |||||||||||||||||||||||||||||
| 315 | |||||||||||||||||||||||||||||||
| 316 | 0 | ▶ | my $url = $manual->inherited($subroutine) ? "M<".$subroutine->manual."::$name>" : "M<$name>"; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 317 | 0 | ▶ | $output->print( $self->cleanup($manual, $url), ($args{last} ? ".\n" : ",\n") ); | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 318 | } | ||||||||||||||||||||||||||||||
| 319 | |||||||||||||||||||||||||||||||
| 320 | sub showOptions(@) | ||||||||||||||||||||||||||||||
| 321 | 0 | ▶ | { my ($self, %args) = @_; | ||||||||||||||||||||||||||||
|
Subroutine
showOptions: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||
| 322 | 0 | ▶ | my $output = $args{output} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 323 | 0 | $output->print("\n=over 2\n\n"); | |||||||||||||||||||||||||||||
| 324 | 0 | $self->SUPER::showOptions(%args); | |||||||||||||||||||||||||||||
| 325 | 0 | $output->print("\n=back\n\n"); | |||||||||||||||||||||||||||||
| 326 | } | ||||||||||||||||||||||||||||||
| 327 | |||||||||||||||||||||||||||||||
| 328 | sub showOptionUse(@) | ||||||||||||||||||||||||||||||
| 329 | 0 | ▶ | { my ($self, %args) = @_; | ||||||||||||||||||||||||||||
|
Subroutine
showOptionUse: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 330 | 0 | ▶ | my $output = $args{output} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 331 | 0 | ▶ | my $option = $args{option} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 332 | 0 | ▶ | my $manual = $args{manual} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 333 | |||||||||||||||||||||||||||||||
| 334 | 0 | my $params = $option->parameters =~ s/\s+$//r =~ s/^\s+//r; | |||||||||||||||||||||||||||||
| 335 | 0 | ▶ | $params = " => ".$self->cleanup($manual, $params) if length $params; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 336 | |||||||||||||||||||||||||||||||
| 337 | 0 | $output->print("=item $option$params\n\n"); | |||||||||||||||||||||||||||||
| 338 | 0 | $self; | |||||||||||||||||||||||||||||
| 339 | } | ||||||||||||||||||||||||||||||
| 340 | |||||||||||||||||||||||||||||||
| 341 | sub showOptionExpand(@) | ||||||||||||||||||||||||||||||
| 342 | 0 | ▶ | { my ($self, %args) = @_; | ||||||||||||||||||||||||||||
|
Subroutine
showOptionExpand: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||||
| 343 | 0 | ▶ | my $output = $args{output} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 344 | 0 | ▶ | my $option = $args{option} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 345 | 0 | ▶ | my $manual = $args{manual} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 346 | |||||||||||||||||||||||||||||||
| 347 | 0 | $self->showOptionUse(%args); | |||||||||||||||||||||||||||||
| 348 | |||||||||||||||||||||||||||||||
| 349 | 0 | ▶ | my $where = $option->findDescriptionObject or return $self; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 350 | 0 | my $descr = $self->cleanup($manual, $where->description); | |||||||||||||||||||||||||||||
| 351 | 0 | ▶ | $output->print("\n$descr\n\n") if length $descr; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 352 | 0 | $self; | |||||||||||||||||||||||||||||
| 353 | } | ||||||||||||||||||||||||||||||
| 354 | |||||||||||||||||||||||||||||||
| 355 | |||||||||||||||||||||||||||||||
| 356 | sub writeTable($@) | ||||||||||||||||||||||||||||||
| 357 | 0 | ▶ | { my ($self, %args) = @_; | ||||||||||||||||||||||||||||
|
Subroutine
writeTable: not called CC=13 SCAR=52.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 358 | |||||||||||||||||||||||||||||||
| 359 | 0 | ▶ | my $head = $args{header} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 360 | 0 | ▶ | my $output = $args{output} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 361 | 0 | ▶ | my $rows = $args{rows} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 362 | 0 | ▶ | @$rows or return; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 363 | |||||||||||||||||||||||||||||||
| 364 | # Convert all elements to plain text, because markup is not | ||||||||||||||||||||||||||||||
| 365 | # allowed in verbatim pod blocks. | ||||||||||||||||||||||||||||||
| 366 | 0 | my @rows; | |||||||||||||||||||||||||||||
| 367 | 0 | foreach my $row (@$rows) | |||||||||||||||||||||||||||||
| 368 | 0 | { push @rows, [ map {$self->removeMarkup($_)} @$row ]; | |||||||||||||||||||||||||||||
| 369 | } | ||||||||||||||||||||||||||||||
| 370 | |||||||||||||||||||||||||||||||
| 371 | # Compute column widths | ||||||||||||||||||||||||||||||
| 372 | 0 | my @w = (0) x @$head; | |||||||||||||||||||||||||||||
| 373 | |||||||||||||||||||||||||||||||
| 374 | 0 | foreach my $row ($head, @rows) | |||||||||||||||||||||||||||||
| 375 | { $w[$_] = max $w[$_], length($row->[$_]) | ||||||||||||||||||||||||||||||
| 376 | 0 | foreach 0..$#$row; | |||||||||||||||||||||||||||||
| 377 | } | ||||||||||||||||||||||||||||||
| 378 | |||||||||||||||||||||||||||||||
| 379 | 0 | ▶ | if(my $widths = $args{widths}) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 380 | { defined $widths->[$_] && $widths->[$_] > $w[$_] && ($w[$_] = $widths->[$_]) | ||||||||||||||||||||||||||||||
| 381 | 0 | ▶ | for 0..$#$rows; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $widths->[$_] and $widths->[$_] > $w[$_]
MC/DC0%0/2
defined $widths->[$_] and $widths->[$_] > $w[$_]
defined $widths->[$_]
$widths->[$_] > $w[$_]
Truth table0%0/3
A and B
A= defined $widths->[$_]B= $widths->[$_] > $w[$_]
| |||||||||||||||||||||||||||||||
| 382 | } | ||||||||||||||||||||||||||||||
| 383 | |||||||||||||||||||||||||||||||
| 384 | 0 | pop @w; # ignore width of last column | |||||||||||||||||||||||||||||
| 385 | |||||||||||||||||||||||||||||||
| 386 | # Table head | ||||||||||||||||||||||||||||||
| 387 | 0 | my $headf = " -".join("--", map "\%-${_}s", @w)."--%s\n"; | |||||||||||||||||||||||||||||
| 388 | 0 | $output->printf($headf, @$head); | |||||||||||||||||||||||||||||
| 389 | |||||||||||||||||||||||||||||||
| 390 | # Table body | ||||||||||||||||||||||||||||||
| 391 | 0 | my $format = " ".join(" ", map "\%-${_}s", @w)." %s\n"; | |||||||||||||||||||||||||||||
| 392 | 0 | $output->printf($format, @$_) for @rows; | |||||||||||||||||||||||||||||
| 393 | } | ||||||||||||||||||||||||||||||
| 394 | |||||||||||||||||||||||||||||||
| 395 | |||||||||||||||||||||||||||||||
| 396 | sub removeMarkup($) | ||||||||||||||||||||||||||||||
| 397 | 20 | ▶ | { my ($self, $string) = @_; | ||||||||||||||||||||||||||||
|
Subroutine
removeMarkup: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||
| 398 | 20 | my $out = $self->_removeMarkup($string); | |||||||||||||||||||||||||||||
| 399 | 20 | for($out) | |||||||||||||||||||||||||||||
| 400 | 20 | { s/^\s+//gm; | |||||||||||||||||||||||||||||
| 401 | 20 | s/\s+$//gm; | |||||||||||||||||||||||||||||
| 402 | 20 | s/\s{2,}/ /g; | |||||||||||||||||||||||||||||
| 403 | 20 | s/\[NB\]/ /g; | |||||||||||||||||||||||||||||
| 404 | } | ||||||||||||||||||||||||||||||
| 405 | 20 | $out; | |||||||||||||||||||||||||||||
| 406 | } | ||||||||||||||||||||||||||||||
| 407 | |||||||||||||||||||||||||||||||
| 408 | sub _removeMarkup($) | ||||||||||||||||||||||||||||||
| 409 | 37 | ▶ | { my ($self, $string) = @_; | ||||||||||||||||||||||||||||
|
Subroutine
_removeMarkup: called CC=14 SCAR=27.7
| |||||||||||||||||||||||||||||||
| 410 | |||||||||||||||||||||||||||||||
| 411 | 37 | my $out = ''; | |||||||||||||||||||||||||||||
| 412 | 37 | ▶ | while($string =~ s/ | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 413 | (.*?) # before | ||||||||||||||||||||||||||||||
| 414 | ([BCEFILSXZ]) # known formatting codes | ||||||||||||||||||||||||||||||
| 415 | ([<]+) # capture ALL starters | ||||||||||||||||||||||||||||||
| 416 | //x) | ||||||||||||||||||||||||||||||
| 417 | 27 | { $out .= $1; | |||||||||||||||||||||||||||||
| 418 | 27 | my ($tag, $bracks, $brack_count) = ($2, $3, length($3)); | |||||||||||||||||||||||||||||
| 419 | |||||||||||||||||||||||||||||||
| 420 | 27 | ▶ | if($string !~ s/^(|.*?[^>]) # contained | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 421 | [>]{$brack_count} | ||||||||||||||||||||||||||||||
| 422 | (?![>]) | ||||||||||||||||||||||||||||||
| 423 | //xs) | ||||||||||||||||||||||||||||||
| 424 | 0 | { $out .= "$tag$bracks"; | |||||||||||||||||||||||||||||
| 425 | 0 | next; | |||||||||||||||||||||||||||||
| 426 | } | ||||||||||||||||||||||||||||||
| 427 | |||||||||||||||||||||||||||||||
| 428 | 27 | my $container = $1; | |||||||||||||||||||||||||||||
| 429 | 27 | ▶ | if($tag =~ m/[XZ]/) { ; } # ignore container content | ||||||||||||||||||||||||||||
|
Branch: 6 branches
| |||||||||||||||||||||||||||||||
| 430 | elsif($tag =~ m/[BCI]/) # cannot display, but can be nested | ||||||||||||||||||||||||||||||
| 431 | 13 | { $out .= $self->_removeMarkup($container); | |||||||||||||||||||||||||||||
| 432 | } | ||||||||||||||||||||||||||||||
| 433 | 3 | elsif($tag eq 'E') { $out .= e2char($container) } | |||||||||||||||||||||||||||||
| 434 | 0 | elsif($tag eq 'F') { $out .= $container } | |||||||||||||||||||||||||||||
| 435 | elsif($tag eq 'L') | ||||||||||||||||||||||||||||||
| 436 | 8 | ▶ | { if($container =~ m!^\s*([^/|]*)\|!) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 437 | 4 | { $out .= $self->_removeMarkup($1); | |||||||||||||||||||||||||||||
| 438 | 4 | next; | |||||||||||||||||||||||||||||
| 439 | } | ||||||||||||||||||||||||||||||
| 440 | |||||||||||||||||||||||||||||||
| 441 | 4 | my ($man, $chapter) = ($container, ''); | |||||||||||||||||||||||||||||
| 442 | 4 | ▶ | if($container =~ m!^\s*([^/]*)/\"([^"]*)\"\s*$!) | ||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||
| 443 | 2 | { ($man, $chapter) = ($1, $2); | |||||||||||||||||||||||||||||
| 444 | } | ||||||||||||||||||||||||||||||
| 445 | elsif($container =~ m!^\s*([^/]*)/(.*?)\s*$!) | ||||||||||||||||||||||||||||||
| 446 | 1 | { ($man, $chapter) = ($1, $2); | |||||||||||||||||||||||||||||
| 447 | } | ||||||||||||||||||||||||||||||
| 448 | |||||||||||||||||||||||||||||||
| 449 | $out .= | ||||||||||||||||||||||||||||||
| 450 | 4 | ▶ | ( !length $man ? "section $chapter" | ||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||
| 451 | : !length $chapter ? $man | ||||||||||||||||||||||||||||||
| 452 | : "$man section $chapter" | ||||||||||||||||||||||||||||||
| 453 | ); | ||||||||||||||||||||||||||||||
| 454 | } | ||||||||||||||||||||||||||||||
| 455 | elsif($tag eq 'S') | ||||||||||||||||||||||||||||||
| 456 | 0 | { my $clean = $self->_removeMarkup($container); | |||||||||||||||||||||||||||||
| 457 | 0 | $clean =~ s/ /[NB]/g; | |||||||||||||||||||||||||||||
| 458 | 0 | $out .= $clean; | |||||||||||||||||||||||||||||
| 459 | } | ||||||||||||||||||||||||||||||
| 460 | } | ||||||||||||||||||||||||||||||
| 461 | |||||||||||||||||||||||||||||||
| 462 | 37 | $out . $string; | |||||||||||||||||||||||||||||
| 463 | } | ||||||||||||||||||||||||||||||
| 464 | |||||||||||||||||||||||||||||||
| 465 | sub showSubroutineDescription(@) | ||||||||||||||||||||||||||||||
| 466 | 0 | ▶ | { my ($self, %args) = @_; | ||||||||||||||||||||||||||||
|
Subroutine
showSubroutineDescription: not called CC=9 SCAR=45.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 467 | 0 | ▶ | my $manual = $args{manual} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 468 | 0 | ▶ | my $output = $args{output} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 469 | 0 | ▶ | my $subroutine = $args{subroutine} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 470 | |||||||||||||||||||||||||||||||
| 471 | # Z<> will cause an empty body when the description is missing, so there | ||||||||||||||||||||||||||||||
| 472 | # will be a blank line to the next sub description. | ||||||||||||||||||||||||||||||
| 473 | 0 | my $text = $self->cleanup($manual, $subroutine->description); | |||||||||||||||||||||||||||||
| 474 | 0 | my $extends = $subroutine->extends; | |||||||||||||||||||||||||||||
| 475 | 0 | ▶ | my $refer = $extends ? $extends->findDescriptionObject : undef; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 476 | 0 | ▶ | $text ||= $self->cleanup($manual, "Z<>\n") unless $refer; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$text ||= $self->cleanup($manual, "Z<>\n")
MC/DC0%0/2
$text ||= $self->cleanup($manual, "Z<>\n")
$text
$self->cleanup($manual, "Z<>\n")
Truth table0%0/3
A ||= B
A= $textB= $self->cleanup($manual, "Z<>\n")
| |||||||||||||||||||||||||||||||
| 477 | |||||||||||||||||||||||||||||||
| 478 | 0 | ▶ | $output->print("\n", $text) if length $text; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 479 | 0 | ▶ | $output->print("Improves base, see ",$self->link($manual, $refer),"\n") if $refer; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 480 | } | ||||||||||||||||||||||||||||||
| 481 | |||||||||||||||||||||||||||||||
| 482 | sub showSubroutineDescriptionRefer(@) | ||||||||||||||||||||||||||||||
| 483 | 0 | ▶ | { my ($self, %args) = @_; | ||||||||||||||||||||||||||||
|
Subroutine
showSubroutineDescriptionRefer: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||||
| 484 | 0 | ▶ | my $manual = $args{manual} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 485 | 0 | ▶ | my $output = $args{output} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 486 | 0 | ▶ | my $subroutine = $args{subroutine} or panic; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 487 | 0 | $output->print("\nInherited, see ",$self->link($manual, $subroutine),"\n"); | |||||||||||||||||||||||||||||
| 488 | } | ||||||||||||||||||||||||||||||
| 489 | |||||||||||||||||||||||||||||||
| 490 | 0 | ▶ | sub showSubsIndex() {;} | ||||||||||||||||||||||||||||
|
Subroutine
showSubsIndex: not called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||
| 491 | |||||||||||||||||||||||||||||||
| 492 | |||||||||||||||||||||||||||||||
| 493 | sub simplifyPod($$) | ||||||||||||||||||||||||||||||
| 494 | 0 | ▶ | { my ($self, $infn, $outfn) = @_; | ||||||||||||||||||||||||||||
|
Subroutine
simplifyPod: not called CC=7 SCAR=40.3
Pod
documented
| |||||||||||||||||||||||||||||||
| 495 | |||||||||||||||||||||||||||||||
| 496 | 0 | ▶ | open my $in, '<:encoding(UTF-8)', $infn | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 497 | or fault __x"cannot read prelimary pod from {file}", file => $infn; | ||||||||||||||||||||||||||||||
| 498 | |||||||||||||||||||||||||||||||
| 499 | 0 | ▶ | open my $out, '>:encoding(UTF-8)', $outfn | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 500 | or fault __x"cannot write final pod to {file}", file => $outfn; | ||||||||||||||||||||||||||||||
| 501 | |||||||||||||||||||||||||||||||
| 502 | 0 | my $last_is_blank = 1; | |||||||||||||||||||||||||||||
| 503 | LINE: | ||||||||||||||||||||||||||||||
| 504 | 0 | ▶ | while(my $l = $in->getline) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 505 | 0 | ▶ | { if($l =~ m/^\s*$/s) | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 506 | 0 | ▶ | { next LINE if $last_is_blank; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 507 | 0 | $last_is_blank = 1; | |||||||||||||||||||||||||||||
| 508 | } | ||||||||||||||||||||||||||||||
| 509 | else | ||||||||||||||||||||||||||||||
| 510 | 0 | { $last_is_blank = 0; | |||||||||||||||||||||||||||||
| 511 | } | ||||||||||||||||||||||||||||||
| 512 | |||||||||||||||||||||||||||||||
| 513 | 0 | $out->print($l); | |||||||||||||||||||||||||||||
| 514 | } | ||||||||||||||||||||||||||||||
| 515 | |||||||||||||||||||||||||||||||
| 516 | 0 | $in->close; | |||||||||||||||||||||||||||||
| 517 | 0 | ▶ | $out->close | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 518 | or fault __x"write to {file} failed", file => $outfn; | ||||||||||||||||||||||||||||||
| 519 | |||||||||||||||||||||||||||||||
| 520 | 0 | $self; | |||||||||||||||||||||||||||||
| 521 | } | ||||||||||||||||||||||||||||||
| 522 | |||||||||||||||||||||||||||||||
| 523 | #-------------------- | ||||||||||||||||||||||||||||||
| 524 | |||||||||||||||||||||||||||||||
| 525 | 2 | 1; | |||||||||||||||||||||||||||||