13 |
documentation => 'Name of class to parse', |
documentation => 'Name of class to parse', |
14 |
); |
); |
15 |
|
|
16 |
sub attribute_order { |
my $ppi_doc; |
17 |
|
|
18 |
|
sub doc { |
19 |
my ( $self ) = @_; |
my ( $self ) = @_; |
20 |
|
|
21 |
my $doc = PPI::Document->new( $self->class_path( $self->class ) ) || die $!; |
if ( ! $ppi_doc ) { |
22 |
|
warn "# parse ", $self->class; |
23 |
|
my $doc = PPI::Document->new( $self->class_path( $self->class ) ) || die $!; |
24 |
|
$doc->prune('PPI::Token::Whitespace'); |
25 |
|
$ppi_doc = $doc; |
26 |
|
} |
27 |
|
return $ppi_doc; |
28 |
|
} |
29 |
|
|
30 |
|
sub attribute_order { |
31 |
|
my ( $self ) = @_; |
32 |
|
|
33 |
$doc->prune('PPI::Token::Whitespace'); |
my $doc = $self->doc; |
34 |
|
|
35 |
my @attribute_order; |
my @attribute_order; |
36 |
|
|
50 |
|
|
51 |
sub data { |
sub data { |
52 |
my $self = shift; |
my $self = shift; |
53 |
[ $self->attribute_order ]; |
my $doc = $self->doc; |
54 |
|
my $include; |
55 |
|
$doc->find( sub { |
56 |
|
my ($doc,$el) = @_; |
57 |
|
if ( $el->isa('PPI::Statement::Include') ) { |
58 |
|
warn dump( $el->module, $el->type, $el->pragma ); |
59 |
|
push @{ $include->{ $el->type } }, $el->module |
60 |
|
} |
61 |
|
return 1; |
62 |
|
}); |
63 |
|
warn "# ", $self->class, " ", dump( $include ) if $self->debug; |
64 |
|
|
65 |
|
return { |
66 |
|
include => $include, |
67 |
|
doc => $doc, |
68 |
|
}; |
69 |
} |
} |
70 |
|
|
71 |
1; |
1; |