| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Astro::App::Satpass2::ParseTime::Code; |
|
2
|
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
2047
|
use 5.008; |
|
|
2
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
11
|
use strict; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
82
|
|
|
6
|
2
|
|
|
2
|
|
13
|
use warnings; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
81
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
29
|
use parent qw{ Astro::App::Satpass2::ParseTime }; |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
33
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
163
|
use Astro::App::Satpass2::Utils qw{ CODE_REF HASH_REF @CARP_NOT }; |
|
|
2
|
|
|
|
|
95
|
|
|
|
2
|
|
|
|
|
284
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.051_01'; |
|
13
|
|
|
|
|
|
|
|
|
14
|
2
|
|
|
2
|
|
16
|
use constant DUMMY => 'DUMMY'; |
|
|
2
|
|
|
|
|
75
|
|
|
|
2
|
|
|
|
|
1402
|
|
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# __arguments() is normally called as a subroutine, but it needs access |
|
17
|
|
|
|
|
|
|
# to this namespace to figure out the options, so we just load this |
|
18
|
|
|
|
|
|
|
# module and then call __arguments() as a static method. |
|
19
|
|
|
|
|
|
|
require Astro::App::Satpass2; |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub attribute_names { |
|
22
|
1
|
|
|
1
|
1
|
3
|
my ( $self ) = @_; |
|
23
|
1
|
|
|
|
|
6
|
return ( $self->SUPER::attribute_names(), qw{ code } ); |
|
24
|
|
|
|
|
|
|
} |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub class_name_of_record { |
|
27
|
0
|
|
|
0
|
1
|
0
|
my ( $self ) = @_; |
|
28
|
0
|
|
|
|
|
0
|
my $code = $self->code(); |
|
29
|
0
|
0
|
|
|
|
0
|
ref $code |
|
30
|
|
|
|
|
|
|
and $code = DUMMY; |
|
31
|
0
|
|
|
|
|
0
|
return $code; |
|
32
|
|
|
|
|
|
|
} |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub code { |
|
35
|
1
|
|
|
1
|
1
|
3
|
my ( $self, @args ) = @_; |
|
36
|
1
|
50
|
|
|
|
4
|
if ( @args ) { |
|
37
|
1
|
|
|
|
|
3
|
my ( $val, $name ) = @args; |
|
38
|
1
|
50
|
|
|
|
4
|
if ( my $ref = ref $val ) { |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
39
|
1
|
50
|
|
|
|
4
|
if ( CODE_REF eq $ref ) { |
|
40
|
1
|
50
|
|
|
|
3
|
defined $name |
|
41
|
|
|
|
|
|
|
or $name = $val; |
|
42
|
1
|
|
|
|
|
4
|
return $self->_code_storage( $name, $val ); |
|
43
|
|
|
|
|
|
|
} |
|
44
|
|
|
|
|
|
|
} elsif ( $val =~ m/ ( .* ) :: ( .* ) /smx ) { |
|
45
|
0
|
0
|
|
|
|
0
|
if ( my $code = $1->can( $2 ) ) { |
|
46
|
0
|
|
|
|
|
0
|
return $self->_code_storage( $val, $code ); |
|
47
|
|
|
|
|
|
|
} |
|
48
|
|
|
|
|
|
|
} elsif ( my $code = caller->can( $val ) ) { |
|
49
|
0
|
|
|
|
|
0
|
return $self->_code_storage( $val, $code ); |
|
50
|
|
|
|
|
|
|
} |
|
51
|
|
|
|
|
|
|
$self->wail( |
|
52
|
0
|
|
|
|
|
0
|
'Code attribute must be a CODE ref or a subroutine name' ); |
|
53
|
|
|
|
|
|
|
} |
|
54
|
0
|
|
|
|
|
0
|
return $self->_attr()->{code}; |
|
55
|
|
|
|
|
|
|
} |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub delegate { |
|
58
|
3
|
|
|
3
|
1
|
1749
|
return __PACKAGE__; |
|
59
|
|
|
|
|
|
|
} |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub parse_time_absolute { |
|
62
|
18
|
|
|
18
|
1
|
38
|
my ( $self, $string ) = @_; |
|
63
|
18
|
|
|
|
|
43
|
return $self->_call_code( parse => $string ); |
|
64
|
|
|
|
|
|
|
} |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub tz { |
|
67
|
0
|
|
|
0
|
1
|
0
|
my ( $self, @args ) = @_; |
|
68
|
|
|
|
|
|
|
@args |
|
69
|
0
|
0
|
|
|
|
0
|
and $self->_call_code( tz => $args[0] ); |
|
70
|
0
|
|
|
|
|
0
|
return $self->SUPER::tz( @args ); |
|
71
|
|
|
|
|
|
|
} |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub use_perltime { |
|
74
|
0
|
|
|
0
|
1
|
0
|
my ( $self ) = @_; |
|
75
|
0
|
|
|
|
|
0
|
return $self->_call_code( 'use_perltime' ); |
|
76
|
|
|
|
|
|
|
} |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub _attr { |
|
79
|
19
|
|
|
19
|
|
36
|
my ( $self ) = @_; |
|
80
|
19
|
|
|
|
|
31
|
my $pkg = __PACKAGE__; |
|
81
|
19
|
|
100
|
|
|
73
|
return $self->{$pkg} ||= {}; |
|
82
|
|
|
|
|
|
|
} |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub _call_code { |
|
85
|
18
|
|
|
18
|
|
42
|
my ( $self, @args ) = @_; |
|
86
|
18
|
|
|
|
|
63
|
( undef, @args ) = Astro::App::Satpass2->__arguments( @args ); |
|
87
|
|
|
|
|
|
|
my $code = $self->_attr()->{_code} |
|
88
|
18
|
50
|
|
|
|
50
|
or $self->wail( 'No code specified' ); |
|
89
|
18
|
|
|
|
|
53
|
return $code->( $self, @args ); |
|
90
|
|
|
|
|
|
|
} |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
sub _code_storage { |
|
93
|
1
|
|
|
1
|
|
2
|
my ( $self, $name, $code ) = @_; |
|
94
|
1
|
|
|
|
|
3
|
my $attr = $self->_attr(); |
|
95
|
1
|
|
|
|
|
3
|
$attr->{code} = $name; |
|
96
|
1
|
|
|
|
|
4
|
$attr->{_code} = $code; |
|
97
|
1
|
|
|
|
|
5
|
return $self; |
|
98
|
|
|
|
|
|
|
} |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
1; |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
__END__ |