Skip to content

Commit 2607f1e

Browse files
committed
Support trailing commas in inline tables
1 parent 2c06ece commit 2607f1e

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/table.zig

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,12 @@ pub fn parseInlineTable(ctx: *parser.Context) !?*Table {
177177
try parser.consumeString(ctx, "}");
178178
break;
179179
};
180+
181+
spaces.skipSpacesAndLineBreaks(ctx);
182+
parser.consumeString(ctx, "}") catch {
183+
continue;
184+
};
185+
break;
180186
}
181187

182188
return table;
@@ -219,7 +225,7 @@ test "multi-line inline table" {
219225
var ctx = parser.testInput(
220226
\\{
221227
\\ aa = 3,
222-
\\ bb.cc = 4
228+
\\ bb.cc = 4,
223229
\\}
224230
);
225231
var m = (try parseInlineTable(&ctx)).?;

0 commit comments

Comments
 (0)