mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-18 10:28:09 +08:00
@@ -1836,12 +1836,12 @@ result<Value, std::string> parse_toml_file(location<Container>& loc)
|
|||||||
const auto first = loc.iter();
|
const auto first = loc.iter();
|
||||||
if(first == loc.end())
|
if(first == loc.end())
|
||||||
{
|
{
|
||||||
return ok(value_type(table_type{}));
|
return ok(value_type(table_type{}, /* empty file has no region ...*/));
|
||||||
}
|
}
|
||||||
|
|
||||||
// put the first line as a region of a file
|
// put the first line as a region of a file
|
||||||
const region<Container> file(loc, loc.iter(),
|
// Here first != loc.end(), so taking std::next is okay
|
||||||
std::find(loc.iter(), loc.end(), '\n'));
|
const region<Container> file(loc, first, std::next(loc.iter()));
|
||||||
|
|
||||||
// The first successive comments that are separated from the first value
|
// The first successive comments that are separated from the first value
|
||||||
// by an empty line are for a file itself.
|
// by an empty line are for a file itself.
|
||||||
|
Reference in New Issue
Block a user