/[Frey]/trunk/lib/Frey/PPI.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/Frey/PPI.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1104 by dpavlin, Sun Jun 28 20:34:40 2009 UTC revision 1105 by dpavlin, Mon Jun 29 14:09:34 2009 UTC
# Line 29  has 'doc' => ( Line 29  has 'doc' => (
29          },          },
30  );  );
31    
32  sub find {  sub find_doc_el {
33          my ( $self, $coderef ) = @_;          my ( $self, $coderef ) = @_;
34    
35          my $doc = $self->doc;          my $doc = $self->doc;
# Line 44  sub attribute_order { Line 44  sub attribute_order {
44          my ( $self ) = @_;          my ( $self ) = @_;
45    
46          my @attribute_order;          my @attribute_order;
47          $self->find(sub {          $self->find_doc_el(sub {
48                  my ($doc,$el) = @_;                  my ($doc,$el) = @_;
49                  return unless                  return unless
50                          $el->isa('PPI::Statement') &&                          $el->isa('PPI::Statement') &&
# Line 65  sub includes { Line 65  sub includes {
65          my $self = shift;          my $self = shift;
66    
67          my $include;          my $include;
68          $self->find(sub {          $self->find_doc_el(sub {
69                  my ($doc,$el) = @_;                  my ($doc,$el) = @_;
70                  return unless $el->isa('PPI::Statement::Include');                  return unless $el->isa('PPI::Statement::Include');
71    
# Line 87  sub parse_tests { Line 87  sub parse_tests {
87    
88                  warn "## ppi test $_" if $self->debug;                  warn "## ppi test $_" if $self->debug;
89    
90                  my $doc = Frey::PPI->new( class => $_ );                  my $ppi = Frey::PPI->new( class => $_ );
91                  my @tests;                  my @tests;
92    
93  #               warn "## ",dump( $doc );  #               warn "## ",dump( $doc );
94    
95                  $doc->find(sub {                  $ppi->find_doc_el(sub {
96                          my ($doc,$el) = @_;                          my ($doc,$el) = @_;
97                          return unless                          return unless
98                                  $el->isa('PPI::Statement') &&                                  $el->isa('PPI::Statement') &&
# Line 125  sub has_tests { Line 125  sub has_tests {
125          if ( my $tests = $class_has_tests->{ $class } ) {          if ( my $tests = $class_has_tests->{ $class } ) {
126                  my @tests = keys %$tests;                  my @tests = keys %$tests;
127                  warn "# has_tests $class ",dump( @tests );                  warn "# has_tests $class ",dump( @tests );
128                  return @tests if wantarray;                  return @tests;
                 return \@tests;  
129          }          }
130  }  }
131    

Legend:
Removed from v.1104  
changed lines
  Added in v.1105

  ViewVC Help
Powered by ViewVC 1.1.26