mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-18 02:08:09 +08:00
fix: serialization of array containing a table
table in a (hetero-) array should be force-inlined
This commit is contained in:
@@ -309,7 +309,17 @@ struct serializer
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
std::string next_elem;
|
std::string next_elem;
|
||||||
|
if(item.is_table())
|
||||||
|
{
|
||||||
|
serializer ser(*this);
|
||||||
|
ser.can_be_inlined_ = true;
|
||||||
|
ser.width_ = std::numeric_limits<std::size_t>::max();
|
||||||
|
next_elem += toml::visit(ser, item);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
next_elem += toml::visit(*this, item);
|
next_elem += toml::visit(*this, item);
|
||||||
|
}
|
||||||
|
|
||||||
// comma before newline.
|
// comma before newline.
|
||||||
if(!next_elem.empty() && next_elem.back() == '\n') {next_elem.pop_back();}
|
if(!next_elem.empty() && next_elem.back() == '\n') {next_elem.pop_back();}
|
||||||
|
Reference in New Issue
Block a user