Merge branch 'master' into std-filesystem

This commit is contained in:
ToruNiina
2020-06-06 17:25:26 +09:00
6 changed files with 45 additions and 92 deletions

View File

@@ -740,7 +740,13 @@ parse_local_time(location<Container>& loc)
case 0: break;
default: break;
}
if(sf.size() >= 6)
if(sf.size() >= 9)
{
time.millisecond = from_string<std::uint16_t>(sf.substr(0, 3), 0u);
time.microsecond = from_string<std::uint16_t>(sf.substr(3, 3), 0u);
time.nanosecond = from_string<std::uint16_t>(sf.substr(6, 3), 0u);
}
else if(sf.size() >= 6)
{
time.millisecond = from_string<std::uint16_t>(sf.substr(0, 3), 0u);
time.microsecond = from_string<std::uint16_t>(sf.substr(3, 3), 0u);
@@ -984,7 +990,12 @@ parse_array(location<Container>& loc)
if(auto val = parse_value<value_type>(loc))
{
#ifndef TOML11_USE_UNRELEASED_TOML_FEATURES
// After TOML v1.0.0-rc.1, array becomes to be able to have values
// with different types. So here we will omit this by default.
//
// But some of the test-suite checks if the parser accepts a hetero-
// geneous arrays, so we keep this for a while.
#ifdef TOML11_DISALLOW_HETEROGENEOUS_ARRAYS
if(!retval.empty() && retval.front().type() != val.as_ok().type())
{
auto array_start_loc = loc;
@@ -1396,9 +1407,6 @@ insert_nested_key(typename Value::table_type& root, const Value& v,
// According to toml-lang/toml:36d3091b3 "Clarify that inline
// tables are immutable", check if it adds key-value pair to an
// inline table.
// This is one of the unreleased (after-0.5.0) toml feature.
// But this is marked as "Clarify", so TOML-lang intended that
// inline tables are immutable in all version.
{
// here, if the value is a (multi-line) table, the region
// should be something like `[table-name]`.