From 536b23dc8442853e4a3975fb3acb016073f7940b Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Fri, 1 Mar 2019 22:53:16 +0900 Subject: [PATCH] fix: allow empty table in the middle of a file --- toml/parser.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toml/parser.hpp b/toml/parser.hpp index 1deba39..57f2211 100644 --- a/toml/parser.hpp +++ b/toml/parser.hpp @@ -1370,7 +1370,7 @@ result parse_ml_table(location& loc) const auto first = loc.iter(); if(first == loc.end()) { - return err(std::string("toml::parse_ml_table: input is empty")); + return ok(toml::table{}); } // XXX at lest one newline is needed. @@ -1453,7 +1453,7 @@ result parse_toml_file(location& loc) } table data; - /* root object is also table, but without [tablename] */ + // root object is also a table, but without [tablename] if(auto tab = parse_ml_table(loc)) { data = std::move(tab.unwrap());