diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2018-07-10 14:27:07 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2018-07-10 14:27:07 +0200 |
commit | ef4bb8963e1a89da2b62274758361617f5384ce3 (patch) | |
tree | 46c7d15cdf08bfd569d7ae6b2910bf361ec37a08 /lib/Config | |
parent | db3dbb29a2ad58ef2f43d3f9d250e7f90aeaf278 (diff) | |
download | config-parser-ef4bb8963e1a89da2b62274758361617f5384ce3.tar.gz config-parser-ef4bb8963e1a89da2b62274758361617f5384ce3.tar.bz2 |
Switch to Config::AST
Diffstat (limited to 'lib/Config')
-rw-r--r-- | lib/Config/Parser.pm | 12 | ||||
-rw-r--r-- | lib/Config/Parser/Ini.pm | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/Config/Parser.pm b/lib/Config/Parser.pm index 93b23fc..ee5055b 100644 --- a/lib/Config/Parser.pm +++ b/lib/Config/Parser.pm @@ -1,7 +1,7 @@ package Config::Parser; use strict; use warnings; -use parent 'Config::Tree'; +use parent 'Config::AST'; use Carp; use Cwd qw(abs_path); use Text::ParseWords; @@ -23,18 +23,18 @@ sub new { } } - unless ($_{parameters}) { + unless ($_{lexicon}) { my $subs = Class::Inspector->subclasses(__PACKAGE__); if ($subs) { - $_{parameters} = {}; + $_{lexicon} = {}; foreach my $c (@$subs) { # print "LOADING FROM $c\n"; if (my $s = loadsynt($c)) { - $_{parameters} = { %{$_{parameters}}, %$s }; + $_{lexicon} = { %{$_{lexicon}}, %$s }; } last if $c eq $class; } - delete $_{parameters} unless keys %{$_{parameters}}; + delete $_{lexicon} unless keys %{$_{lexicon}}; } } @@ -71,7 +71,7 @@ sub loadsynt { my $d = $class->new(filename => $file, fh => $fh, line => $line, - parameters => { '*' => '*' }) + lexicon => { '*' => '*' }) or croak "Failed to parse template at $file:$line"; close $fh; $d->as_hash(sub { diff --git a/lib/Config/Parser/Ini.pm b/lib/Config/Parser/Ini.pm index 3b39a16..0ea632c 100644 --- a/lib/Config/Parser/Ini.pm +++ b/lib/Config/Parser/Ini.pm @@ -62,7 +62,7 @@ sub _readconfig { } else { $include = 0; $self->add_node(\@path, - new Config::Tree::Node::Section(locus => $locus)); + new Config::AST::Node::Section(locus => $locus)); } } elsif (/([\w_-]+)\s*=\s*(.*)/) { my ($k, $v) = ($1, $2); |