aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2018-07-09 22:39:25 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2018-07-09 22:39:25 +0200
commitdb3dbb29a2ad58ef2f43d3f9d250e7f90aeaf278 (patch)
treefa84a90f7f6b304b083c746aeb09a9cc853c3035
parenteda00b0eaa069d5631efec255ef162b695d73d33 (diff)
downloadconfig-parser-db3dbb29a2ad58ef2f43d3f9d250e7f90aeaf278.tar.gz
config-parser-db3dbb29a2ad58ef2f43d3f9d250e7f90aeaf278.tar.bz2
Use Text::Locus
-rw-r--r--Makefile.PL1
-rw-r--r--lib/Config/Parser.pm2
-rw-r--r--lib/Config/Parser/Ini.pm2
3 files changed, 3 insertions, 2 deletions
diff --git a/Makefile.PL b/Makefile.PL
index 8ff01ae..bc0ba75 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -16,6 +16,7 @@ WriteMakefile(NAME => 'Config::Parser',
16 'Class::Inspector' => 0, 16 'Class::Inspector' => 0,
17 'Data::Dumper' => '2.135_06', 17 'Data::Dumper' => '2.135_06',
18 'File::Temp' => '0.22', 18 'File::Temp' => '0.22',
19 'Text::Locus' => '1.01'
19 }, 20 },
20 META_MERGE => { 21 META_MERGE => {
21 'meta-spec' => { version => 2 }, 22 'meta-spec' => { version => 2 },
diff --git a/lib/Config/Parser.pm b/lib/Config/Parser.pm
index c0a2179..93b23fc 100644
--- a/lib/Config/Parser.pm
+++ b/lib/Config/Parser.pm
@@ -104,7 +104,7 @@ sub loadsynt {
104 && $val =~ /^:(?<kw>.+?)(?:\s*=\s*(?<val>.*))?$/) { 104 && $val =~ /^:(?<kw>.+?)(?:\s*=\s*(?<val>.*))?$/) {
105 $ret->{$+{kw}} = $+{val} // 1; 105 $ret->{$+{kw}} = $+{val} // 1;
106 } 106 }
107 $ret->{default} = $val if $val; 107 $ret->{default} = $val if defined($val);
108 ($name, $ret); 108 ($name, $ret);
109 } 109 }
110 })->{section}; 110 })->{section};
diff --git a/lib/Config/Parser/Ini.pm b/lib/Config/Parser/Ini.pm
index b3a1ef9..3b39a16 100644
--- a/lib/Config/Parser/Ini.pm
+++ b/lib/Config/Parser/Ini.pm
@@ -53,7 +53,7 @@ sub _readconfig {
53 s/#.*//; 53 s/#.*//;
54 next if ($_ eq ""); 54 next if ($_ eq "");
55 55
56 my $locus = new Config::Tree::Locus($file, $line); 56 my $locus = new Text::Locus($file, $line);
57 57
58 if (/^\[(.+?)\]$/) { 58 if (/^\[(.+?)\]$/) {
59 @path = parse_line('\s+', 0, $1); 59 @path = parse_line('\s+', 0, $1);

Return to:

Send suggestions and report system problems to the System administrator.