| 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 | package OODoc::Parser;{ | ||||||||||||||||||||
| 13 | 1 | our $VERSION = '3.05'; | |||||||||||||||||||
| 14 | } | ||||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | 1 | ▶ | use parent 'OODoc::Object'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 19 | 1 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | 1 | ▶ | use Log::Report 'oodoc'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 1 | ▶ | use List::Util qw/first/; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 24 | 1 | ▶ | use Scalar::Util qw/reftype/; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | 1 | our %syntax_implementation = ( | |||||||||||||||||||
| 27 | markov => 'OODoc::Parser::Markov', | ||||||||||||||||||||
| 28 | ); | ||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | #-------------------- | ||||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | #-------------------- | ||||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | sub new(%) | ||||||||||||||||||||
| 35 | 0 | ▶ | { my ($class, %args) = @_; | ||||||||||||||||||
|
Subroutine
new: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||
| 36 | |||||||||||||||||||||
| 37 | 0 | ▶ | $class eq __PACKAGE__ | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 38 | or return $class->SUPER::new(%args); | ||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | 0 | ▶ | my $syntax = delete $args{syntax} || 'markov'; | ||||||||||||||||||
|
Condition0%0/2
delete $args{'syntax'} || 'markov'
MC/DC0%0/1
delete $args{'syntax'} || 'markov'
delete $args{'syntax'}
Truth table0%0/2
A
A= delete $args{'syntax'}
| |||||||||||||||||||||
| 41 | 0 | ▶ | my $pkg = $syntax_implementation{$syntax} || $syntax; | ||||||||||||||||||
|
Condition0%0/3
$OODoc::Parser::syntax_implementation{$syntax} || $syntax
MC/DC0%0/2
$OODoc::Parser::syntax_implementation{$syntax} || $syntax
$OODoc::Parser::syntax_implementation{$syntax}
$syntax
Truth table0%0/3
A || B
A= $OODoc::Parser::syntax_implementation{$syntax}B= $syntax
| |||||||||||||||||||||
| 42 | 0 | ▶ | eval "require $pkg" or die $@; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 43 | 0 | $pkg->new(%args); | |||||||||||||||||||
| 44 | } | ||||||||||||||||||||
| 45 | |||||||||||||||||||||
| 46 | sub init($) | ||||||||||||||||||||
| 47 | 0 | ▶ | { my ($self, $args) = @_; | ||||||||||||||||||
|
Subroutine
init: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||
| 48 | 0 | ▶ | $self->SUPER::init($args) or return; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 49 | |||||||||||||||||||||
| 50 | 0 | ▶ | my $skip = delete $args->{skip_links} || []; | ||||||||||||||||||
|
Condition0%0/2
delete $args->{'skip_links'} || []
MC/DC0%0/1
delete $args->{'skip_links'} || []
delete $args->{'skip_links'}
Truth table0%0/2
A
A= delete $args->{'skip_links'}
| |||||||||||||||||||||
| 51 | 0 | ▶ | my @skip = map { ref $_ eq 'REGEXP' ? $_ : qr/^\Q$_\E(?:\:\:|$)/ } | ||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||
| 52 | ref $skip eq 'ARRAY' ? @$skip : $skip; | ||||||||||||||||||||
| 53 | |||||||||||||||||||||
| 54 | 0 | $self->{skip_links} = \@skip; | |||||||||||||||||||
| 55 | 0 | $self; | |||||||||||||||||||
| 56 | } | ||||||||||||||||||||
| 57 | |||||||||||||||||||||
| 58 | #-------------------- | ||||||||||||||||||||
| 59 | |||||||||||||||||||||
| 60 | 0 | ▶ | sub parse(@) {panic} | ||||||||||||||||||
|
Subroutine
parse: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 61 | |||||||||||||||||||||
| 62 | #-------------------- | ||||||||||||||||||||
| 63 | |||||||||||||||||||||
| 64 | sub skipManualLink($) | ||||||||||||||||||||
| 65 | 0 | ▶ | { my ($self, $package) = @_; | ||||||||||||||||||
|
Subroutine
skipManualLink: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||
| 66 | 0 | ▶ | (first { $package =~ $_ } @{$self->{skip_links}}) ? 1 : 0; | ||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
| |||||||||||||||||||||
| 67 | } | ||||||||||||||||||||
| 68 | |||||||||||||||||||||
| 69 | |||||||||||||||||||||
| 70 | 0 | ▶ | sub cleanupPod($$%) { ... } | ||||||||||||||||||
|
Subroutine
cleanupPod: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 71 | |||||||||||||||||||||
| 72 | |||||||||||||||||||||
| 73 | 0 | ▶ | sub cleanupHtml($$%) { ... } | ||||||||||||||||||
|
Subroutine
cleanupHtml: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 74 | |||||||||||||||||||||
| 75 | |||||||||||||||||||||
| 76 | 0 | ▶ | sub formatReferTo($$) { ... } | ||||||||||||||||||
|
Subroutine
formatReferTo: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 77 | |||||||||||||||||||||
| 78 | |||||||||||||||||||||
| 79 | sub finalizeManual($) | ||||||||||||||||||||
| 80 | 0 | ▶ | { my ($self, $manual, %args) = @_; | ||||||||||||||||||
|
Subroutine
finalizeManual: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 81 | 0 | $self; | |||||||||||||||||||
| 82 | } | ||||||||||||||||||||
| 83 | |||||||||||||||||||||
| 84 | 1 | 1; | |||||||||||||||||||