/[webpac2]/trunk/lib/WebPAC/Parser.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/WebPAC/Parser.pm

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

revision 826 by dpavlin, Sun May 20 16:19:13 2007 UTC revision 976 by dpavlin, Sat Nov 3 12:30:43 2007 UTC
# Line 49  Create new parser object. Line 49  Create new parser object.
49    my $parser = new WebPAC::Parser(    my $parser = new WebPAC::Parser(
50          config => new WebPAC::Config(),          config => new WebPAC::Config(),
51          base_path => '/optional/path/to/conf',          base_path => '/optional/path/to/conf',
52            only_database => $only
53    );    );
54    
55  =cut  =cut
# Line 240  sub _read_sources { Line 241  sub _read_sources {
241    
242          my $lookup_src_cache;          my $lookup_src_cache;
243    
244            my $only_database = $self->{only_database};
245            my $only_input = $self->{only_input};
246    
247          $self->{config}->iterate_inputs( sub {          $self->{config}->iterate_inputs( sub {
248                  my ($input, $database) = @_;                  my ($input, $database) = @_;
249    
250                    return if ( $only_database && $database !~ m/$only_database/i );
251                    return if ( $only_input && $input->{name} !~ m/$only_input/i );
252    
253                  $log->debug("database: $database input = ", dump($input));                  $log->debug("database: $database input = ", dump($input));
254    
255                  foreach my $normalize (@{ $input->{normalize} }) {                  foreach my $normalize (@{ $input->{normalize} }) {
# Line 305  sub _parse_source { Line 312  sub _parse_source {
312    
313          my $Document = PPI::Document->new( \$source ) || $log->logdie("can't parse source:\n", $self->{source});          my $Document = PPI::Document->new( \$source ) || $log->logdie("can't parse source:\n", $self->{source});
314    
315          $Document->prune('PPI::Token::Whitespace');          #$Document->prune('PPI::Token::Whitespace');
316          $Document->prune('PPI::Token::Comment');          $Document->prune('PPI::Token::Comment');
317          #$Document->prune('PPI::Token::Operator');          #$Document->prune('PPI::Token::Operator');
318    

Legend:
Removed from v.826  
changed lines
  Added in v.976

  ViewVC Help
Powered by ViewVC 1.1.26