line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#============================================================= -*-Perl-*- |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# Pod::POM::Node::Sequence |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# DESCRIPTION |
6
|
|
|
|
|
|
|
# Module implementing specific nodes in a Pod::POM, subclassed from |
7
|
|
|
|
|
|
|
# Pod::POM::Node. |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# AUTHOR |
10
|
|
|
|
|
|
|
# Andy Wardley |
11
|
|
|
|
|
|
|
# Andrew Ford |
12
|
|
|
|
|
|
|
# |
13
|
|
|
|
|
|
|
# COPYRIGHT |
14
|
|
|
|
|
|
|
# Copyright (C) 2000, 2001 Andy Wardley. All Rights Reserved. |
15
|
|
|
|
|
|
|
# Copyright (C) 2009 Andrew Ford. All Rights Reserved. |
16
|
|
|
|
|
|
|
# |
17
|
|
|
|
|
|
|
# This module is free software; you can redistribute it and/or |
18
|
|
|
|
|
|
|
# modify it under the same terms as Perl itself. |
19
|
|
|
|
|
|
|
# |
20
|
|
|
|
|
|
|
# REVISION |
21
|
|
|
|
|
|
|
# $Id: Sequence.pm 89 2013-05-30 07:41:52Z ford $ |
22
|
|
|
|
|
|
|
# |
23
|
|
|
|
|
|
|
#======================================================================== |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
package Pod::POM::Node::Sequence; |
26
|
|
|
|
|
|
|
$Pod::POM::Node::Sequence::VERSION = '2.00'; |
27
|
|
|
|
|
|
|
require 5.006; |
28
|
18
|
|
|
18
|
|
75
|
use strict; |
|
18
|
|
|
|
|
26
|
|
|
18
|
|
|
|
|
418
|
|
29
|
18
|
|
|
18
|
|
77
|
use warnings; |
|
18
|
|
|
|
|
27
|
|
|
18
|
|
|
|
|
464
|
|
30
|
|
|
|
|
|
|
|
31
|
18
|
|
|
18
|
|
81
|
use Pod::POM::Constants qw( :all ); |
|
18
|
|
|
|
|
24
|
|
|
18
|
|
|
|
|
2184
|
|
32
|
18
|
|
|
18
|
|
78
|
use parent qw( Pod::POM::Node ); |
|
18
|
|
|
|
|
45
|
|
|
18
|
|
|
|
|
89
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
our %NAME = ( |
35
|
|
|
|
|
|
|
C => 'code', |
36
|
|
|
|
|
|
|
B => 'bold', |
37
|
|
|
|
|
|
|
I => 'italic', |
38
|
|
|
|
|
|
|
L => 'link', |
39
|
|
|
|
|
|
|
S => 'space', |
40
|
|
|
|
|
|
|
F => 'file', |
41
|
|
|
|
|
|
|
X => 'index', |
42
|
|
|
|
|
|
|
Z => 'zero', |
43
|
|
|
|
|
|
|
E => 'entity', |
44
|
|
|
|
|
|
|
); |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub new { |
47
|
832
|
|
|
832
|
0
|
1197
|
my ($class, $self) = @_; |
48
|
832
|
|
|
|
|
1048
|
local $" = '] ['; |
49
|
832
|
|
|
|
|
3949
|
return bless \$self, $class; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub add { |
53
|
0
|
|
|
0
|
0
|
0
|
return IGNORE; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub present { |
57
|
668
|
|
|
668
|
0
|
916
|
my ($self, $view) = @_; |
58
|
668
|
|
|
|
|
659
|
my ($cmd, $method, $result); |
59
|
668
|
|
66
|
|
|
1134
|
$view ||= $Pod::POM::DEFAULT_VIEW; |
60
|
|
|
|
|
|
|
|
61
|
668
|
|
|
|
|
740
|
$self = $$self; |
62
|
668
|
50
|
|
|
|
1343
|
return $self unless ref $self eq 'ARRAY'; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
my $text = join('', |
65
|
976
|
100
|
|
|
|
4448
|
map { ref $_ ? $_->present($view) |
66
|
|
|
|
|
|
|
: $view->view_seq_text($_) } |
67
|
668
|
|
|
|
|
716
|
@{ $self->[CONTENT] }); |
|
668
|
|
|
|
|
1182
|
|
68
|
|
|
|
|
|
|
|
69
|
668
|
100
|
|
|
|
1590
|
if ($cmd = $self->[CMD]) { |
70
|
165
|
|
33
|
|
|
402
|
my $method = $NAME{ $cmd } || $cmd; |
71
|
165
|
|
|
|
|
257
|
$method = "view_seq_$method"; |
72
|
165
|
|
|
|
|
728
|
return $view->$method($text); |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
else { |
75
|
503
|
|
|
|
|
1554
|
return $text; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
1; |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 NAME |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Pod::POM::Node::Sequence - |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 SYNOPSIS |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
use Pod::POM::Nodes; |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 DESCRIPTION |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
This module implements a specialization of the node class to represent sequence elements. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 AUTHOR |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
Andrew Ford Ea.ford@ford-mason.co.ukE |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
Andy Wardley Eabw@kfs.orgE |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head1 COPYRIGHT |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
Copyright (C) 2000, 2001 Andy Wardley. All Rights Reserved. |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
Copyright (C) 2009 Andrew Ford. All Rights Reserved. |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
This module is free software; you can redistribute it and/or |
106
|
|
|
|
|
|
|
modify it under the same terms as Perl itself. |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head1 SEE ALSO |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Consult L for a discussion of nodes. |