Skip to content

Commit

Permalink
Fix malformed output from inline tables
Browse files Browse the repository at this point in the history
  • Loading branch information
antangelo authored and mborgerson committed Nov 8, 2023
1 parent cd32757 commit 62976fa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cnode.h
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,10 @@ class CNode {
}

if (inline_table) {
if (!name.empty()) {
s += name;
s += " = ";
}
s += "{ ";
}

Expand Down Expand Up @@ -631,6 +635,7 @@ class CNode {

for (auto &c : children) {
if (c.type != Table || !c.differs_from_default()) continue;
if (inline_table && i++) s += ", ";
s += c.generate_delta_toml(cpath, inline_table, depth, false);
}

Expand Down

0 comments on commit 62976fa

Please sign in to comment.