--- trunk/lib/WebPAC/Parser.pm 2007/05/20 16:19:13 826 +++ trunk/lib/WebPAC/Parser.pm 2009/07/28 13:55:44 1259 @@ -49,6 +49,7 @@ my $parser = new WebPAC::Parser( config => new WebPAC::Config(), base_path => '/optional/path/to/conf', + only_database => $only ); =cut @@ -240,9 +241,15 @@ my $lookup_src_cache; + my $only_database = $self->{only_database}; + my $only_input = $self->{only_input}; + $self->{config}->iterate_inputs( sub { my ($input, $database) = @_; + return if ( $only_database && $database !~ m/$only_database/i ); + return if ( $only_input && $input->{name} !~ m/$only_input/i ); + $log->debug("database: $database input = ", dump($input)); foreach my $normalize (@{ $input->{normalize} }) { @@ -325,6 +332,13 @@ my ($Document,$Element) = @_; $Element->isa('PPI::Token::Word') or return ''; + + if ( $Element->content eq 'sub' ) { + # repair demage done by prune of whitespace + $Element->insert_after( PPI::Token::Whitespace->new(' ') ); + return ''; + } + $Element->content eq 'lookup' or return ''; $log->debug("expansion: ", $Element->snext_sibling); @@ -399,7 +413,7 @@ } $e[7]->remove; - $e[8]->insert_before( new PPI::Token::Quote::Single( "'$key'" ) ); + $e[8]->insert_before( PPI::Token::Quote::Single->new( "'$key'" ) ); $e[8]->remove;