IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3457


Ignore:
Timestamp:
Mar 18, 2005, 3:01:46 PM (21 years ago)
Author:
jhoblitt
Message:

create a new parser in ->new() instead of ->parse()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/PS-IPP-Metadata-Config/lib/PS/IPP/Metadata/Config.pm

    r3456 r3457  
    11# Copyright (c) 2005  Joshua Hoblitt
    22#
    3 # $Id: Config.pm,v 1.7 2005-03-19 00:45:37 jhoblitt Exp $
     3# $Id: Config.pm,v 1.8 2005-03-19 01:01:46 jhoblitt Exp $
    44
    55package PS::IPP::Metadata::Config;
     
    2525    my $class = shift;
    2626
    27     my $self = {};
     27    my $self = { _parser => Parse::RecDescent->new( $grammar ) };
    2828
    2929    bless $self, $class;
     
    3737    my ( $self, $metadata ) = @_;
    3838
    39     my $tree = Parse::RecDescent->new( $grammar )->startrule( $metadata );
     39    # remove any local data from a prevous run
     40    # this is slightly faster then using Storable::dclone to clone a new parser
     41    delete $self->{_parser}{local};
     42
     43    my $tree = $self->{_parser}->startrule( $metadata );
    4044
    4145    return undef unless defined $tree;
Note: See TracChangeset for help on using the changeset viewer.