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