mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-18 02:08:09 +08:00
fix: if aot is empty, format as oneline
[[aot]] itself defines an empty table, so there is no way to format an empty array-of-tables as table-like format. the only way to format an empty array is: = [].
This commit is contained in:
@@ -557,11 +557,16 @@ class serializer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this->force_inline_ && f == array_format::array_of_tables)
|
if(this->force_inline_ && f == array_format::array_of_tables)
|
||||||
{
|
{
|
||||||
f = array_format::multiline;
|
f = array_format::multiline;
|
||||||
}
|
}
|
||||||
|
if(a.empty() && f == array_format::array_of_tables)
|
||||||
|
{
|
||||||
|
f = array_format::oneline;
|
||||||
|
}
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------
|
||||||
|
|
||||||
if(f == array_format::array_of_tables)
|
if(f == array_format::array_of_tables)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user