chiark / gitweb /
nailing-cargo: Flailings with TOML, *sigh*
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 3 May 2020 21:56:56 +0000 (22:56 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 3 May 2020 21:57:05 +0000 (22:57 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
nailing-cargo

index 92bd8ce8ba120946351c5448115948d4e55da41a..ed95576112426e3d6824b2197d8821acfdecb715 100755 (executable)
@@ -40,6 +40,7 @@
 #    subdir
 
 use strict;
+use TOML::Parser;
 use TOML;
 use POSIX;
 use Fcntl qw(LOCK_EX);
@@ -67,10 +68,11 @@ sub read_or_enoent ($) {
 
 sub toml_or_enoent ($$) {
     my ($f,$what) = @_;
+    my $parser = TOML::Parser->new();
     my $toml = read_or_enoent($f) // return;
-    my ($v,$e) = from_toml($toml);
-    die "$self: parse TOML: $what: $f: $e\n" unless defined $v;
-    die "$e ?" if length $e;
+    my $v = $parser->parse($toml);
+#    die "$self: parse TOML: $what: $f: $e\n" unless defined $v;
+#    die "$e ?" if length $e;
     $v;
 }