line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
24
|
|
|
24
|
|
160
|
use strict; |
|
24
|
|
|
|
|
53
|
|
|
24
|
|
|
|
|
1170
|
|
2
|
24
|
|
|
24
|
|
198
|
use warnings; |
|
24
|
|
|
|
|
51
|
|
|
24
|
|
|
|
|
4098
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package MooseX::Declare::Util; |
5
|
|
|
|
|
|
|
# ABSTRACT: Common declarative utility functions |
6
|
|
|
|
|
|
|
$MooseX::Declare::Util::VERSION = '0.39'; |
7
|
24
|
|
|
|
|
293
|
use Sub::Exporter -setup => { |
8
|
|
|
|
|
|
|
exports => [qw( |
9
|
|
|
|
|
|
|
outer_stack_push |
10
|
|
|
|
|
|
|
outer_stack_pop |
11
|
|
|
|
|
|
|
outer_stack_peek |
12
|
|
|
|
|
|
|
)], |
13
|
24
|
|
|
24
|
|
155
|
}; |
|
24
|
|
|
|
|
51
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
#pod =head1 DESCRIPTION |
16
|
|
|
|
|
|
|
#pod |
17
|
|
|
|
|
|
|
#pod This exporter collection contains the commonly used functions in |
18
|
|
|
|
|
|
|
#pod L<MooseX::Declare>. |
19
|
|
|
|
|
|
|
#pod |
20
|
|
|
|
|
|
|
#pod All functions in this package will be exported upon request. |
21
|
|
|
|
|
|
|
#pod |
22
|
|
|
|
|
|
|
#pod =cut |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
my %OuterStack; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
#pod =func outer_stack_push |
28
|
|
|
|
|
|
|
#pod |
29
|
|
|
|
|
|
|
#pod outer_stack_push (Str $file, Str $value) |
30
|
|
|
|
|
|
|
#pod |
31
|
|
|
|
|
|
|
#pod Pushes the C<$value> on the internal stack for the file C<$file>. |
32
|
|
|
|
|
|
|
#pod |
33
|
|
|
|
|
|
|
#pod =cut |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub outer_stack_push { |
36
|
63
|
|
|
63
|
1
|
193
|
my ($file, $value) = @_; |
37
|
|
|
|
|
|
|
|
38
|
63
|
|
|
|
|
152
|
push @{ $OuterStack{ $file } }, $value; |
|
63
|
|
|
|
|
259
|
|
39
|
63
|
|
|
|
|
368
|
return $value; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
#pod =func outer_stack_pop |
43
|
|
|
|
|
|
|
#pod |
44
|
|
|
|
|
|
|
#pod outer_stack_pop (Str $file) |
45
|
|
|
|
|
|
|
#pod |
46
|
|
|
|
|
|
|
#pod Removes one item from the internal stack of the file C<$file>. |
47
|
|
|
|
|
|
|
#pod |
48
|
|
|
|
|
|
|
#pod =cut |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub outer_stack_pop { |
51
|
60
|
|
|
60
|
1
|
3783917
|
my ($file) = @_; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
return undef |
54
|
60
|
50
|
|
|
|
168
|
unless @{ $OuterStack{ $file } || [] }; |
|
60
|
50
|
|
|
|
537
|
|
55
|
60
|
|
|
|
|
139
|
return pop @{ $OuterStack{ $file } }; |
|
60
|
|
|
|
|
70458
|
|
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
#pod =func outer_stack_peek |
59
|
|
|
|
|
|
|
#pod |
60
|
|
|
|
|
|
|
#pod outer_stack_peek (Str $file) |
61
|
|
|
|
|
|
|
#pod |
62
|
|
|
|
|
|
|
#pod Returns the topmost item in the internal stack for C<$file> without removing |
63
|
|
|
|
|
|
|
#pod it from the stack. |
64
|
|
|
|
|
|
|
#pod |
65
|
|
|
|
|
|
|
#pod =cut |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub outer_stack_peek { |
68
|
77
|
|
|
77
|
1
|
200
|
my ($file) = @_; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
return undef |
71
|
77
|
100
|
|
|
|
135
|
unless @{ $OuterStack{ $file } || [] }; |
|
77
|
100
|
|
|
|
833
|
|
72
|
29
|
|
|
|
|
179
|
return $OuterStack{ $file }[-1]; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
#pod =head1 SEE ALSO |
76
|
|
|
|
|
|
|
#pod |
77
|
|
|
|
|
|
|
#pod =for :list |
78
|
|
|
|
|
|
|
#pod * L<MooseX::Declare> |
79
|
|
|
|
|
|
|
#pod |
80
|
|
|
|
|
|
|
#pod =cut |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
1; |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
__END__ |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=pod |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=encoding UTF-8 |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 NAME |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
MooseX::Declare::Util - Common declarative utility functions |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 VERSION |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
version 0.39 |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 DESCRIPTION |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
This exporter collection contains the commonly used functions in |
101
|
|
|
|
|
|
|
L<MooseX::Declare>. |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
All functions in this package will be exported upon request. |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 FUNCTIONS |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head2 outer_stack_push |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
outer_stack_push (Str $file, Str $value) |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
Pushes the C<$value> on the internal stack for the file C<$file>. |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head2 outer_stack_pop |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
outer_stack_pop (Str $file) |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
Removes one item from the internal stack of the file C<$file>. |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=head2 outer_stack_peek |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
outer_stack_peek (Str $file) |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
Returns the topmost item in the internal stack for C<$file> without removing |
124
|
|
|
|
|
|
|
it from the stack. |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=head1 SEE ALSO |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=over 4 |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=item * |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
L<MooseX::Declare> |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=back |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=head1 AUTHOR |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
Florian Ragwitz <rafl@debian.org> |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
This software is copyright (c) 2008 by Florian Ragwitz. |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
145
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=cut |