[Templates-cvs] cvs commit: TT3/lib/Template/Directive Include.pm

cvs@template-toolkit.org cvs@template-toolkit.org
Fri, 03 Dec 2004 15:51:35 +0000


cvs         04/12/03 15:51:35

  Modified:    lib/Template/Directive Include.pm
  Log:
  * changed parse_path() to parse_paths()
  
  Revision  Changes    Path
  1.7       +9 -11     TT3/lib/Template/Directive/Include.pm
  
  Index: Include.pm
  ===================================================================
  RCS file: /template-toolkit/TT3/lib/Template/Directive/Include.pm,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Include.pm	2004/12/03 14:32:21	1.6
  +++ Include.pm	2004/12/03 15:51:35	1.7
  @@ -15,7 +15,7 @@
   #   modify it under the same terms as Perl itself.
   #
   # REVISION
  -#   $Id: Include.pm,v 1.6 2004/12/03 14:32:21 abw Exp $
  +#   $Id: Include.pm,v 1.7 2004/12/03 15:51:35 abw Exp $
   #
   #========================================================================
   
  @@ -26,7 +26,7 @@
   use Template::Directive;
   use base qw( Template::Directive );
   
  -our $VERSION = sprintf("%d.%02d", q$Revision: 1.6 $ =~ /(\d+)\.(\d+)/);
  +our $VERSION = sprintf("%d.%02d", q$Revision: 1.7 $ =~ /(\d+)\.(\d+)/);
   our $DEBUG   = 0 unless defined $DEBUG;
   our $ERROR   = '';
   our $KEYWORD = 'INCLUDE';
  @@ -38,15 +38,13 @@
       my $parser = $match->{ parser }
           || return $self->error('no parser defined');
   
  -    my $name = $parser->parse_path($textref)
  -        || return $self->error('missing template name in ',
  -                               $self->keyword($match), ' directive');
  -
  -    my $args = $parser->parse_params($textref)
  -        || return $self->error('missing parameters in ',
  -                               $self->keyword($match), ' directive');
  +    my $paths = $parser->parse_paths($textref)
  +        || return $self->error_msg( no_paths => $self->keyword($match));
   
  -    return $handler->expr([ include => $name, $args ])
  +    my $params = $parser->parse_params($textref)
  +        || return $self->error_msg( no_params => $self->keyword($match));
  +
  +    return $handler->expr([ include => $paths, $params ])
           || $self->error($handler->error());
   }
   
  @@ -79,7 +77,7 @@
   
   =head1 VERSION
   
  -$Revision: 1.6 $
  +$Revision: 1.7 $
   
   =head1 COPYRIGHT