line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package PPI::Statement::Break; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=pod |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
PPI::Statement::Break - Statements which break out of normal statement flow |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 SYNOPSIS |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
last; |
12
|
|
|
|
|
|
|
goto FOO; |
13
|
|
|
|
|
|
|
next if condition(); |
14
|
|
|
|
|
|
|
return $foo; |
15
|
|
|
|
|
|
|
redo; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 INHERITANCE |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
PPI::Statement::Break |
20
|
|
|
|
|
|
|
isa PPI::Statement |
21
|
|
|
|
|
|
|
isa PPI::Node |
22
|
|
|
|
|
|
|
isa PPI::Element |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 DESCRIPTION |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
C is intended to represent statements that break |
27
|
|
|
|
|
|
|
out of the normal statement flow control. This covers the basic |
28
|
|
|
|
|
|
|
types C<'redo'>, C<'goto'>, C<'next'>, C<'last'> and C<'return'>. |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 METHODS |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
C has no additional methods beyond the default ones |
33
|
|
|
|
|
|
|
provided by L, L and L. |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
However, it is expected to gain methods for identifying the line to break |
36
|
|
|
|
|
|
|
to, or the structure to break out of. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=cut |
39
|
|
|
|
|
|
|
|
40
|
64
|
|
|
64
|
|
352
|
use strict; |
|
64
|
|
|
|
|
132
|
|
|
64
|
|
|
|
|
1455
|
|
41
|
64
|
|
|
64
|
|
303
|
use PPI::Statement (); |
|
64
|
|
|
|
|
109
|
|
|
64
|
|
|
|
|
3006
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
our $VERSION = '1.276'; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
our @ISA = "PPI::Statement"; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=pod |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 TO DO |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
- Add the methods to identify the break target |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
- Add some proper unit testing |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 SUPPORT |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
See the L in the main module. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 AUTHOR |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Adam Kennedy Eadamk@cpan.orgE |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 COPYRIGHT |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Copyright 2001 - 2011 Adam Kennedy. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
This program is free software; you can redistribute |
70
|
|
|
|
|
|
|
it and/or modify it under the same terms as Perl itself. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
The full text of the license can be found in the |
73
|
|
|
|
|
|
|
LICENSE file included with this module. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut |