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:
ToruNiina
2024-08-06 01:28:45 +09:00
parent 12c0f379f2
commit 80c3e343e7

View File

@@ -557,11 +557,16 @@ class serializer
}
}
}
if(this->force_inline_ && f == array_format::array_of_tables)
{
f = array_format::multiline;
}
if(a.empty() && f == array_format::array_of_tables)
{
f = array_format::oneline;
}
// --------------------------------------------------------------------
if(f == array_format::array_of_tables)
{