aboutsummaryrefslogtreecommitdiff
path: root/src/formatter/formatter.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/formatter/formatter.c')
-rw-r--r--src/formatter/formatter.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/formatter/formatter.c b/src/formatter/formatter.c
index 55fff920..5cb5d3cc 100644
--- a/src/formatter/formatter.c
+++ b/src/formatter/formatter.c
@@ -223,7 +223,8 @@ OptionalText_t format_inline_code(ast_t *ast, Table_t comments) {
}
/*inline*/ case TableEntry: {
DeclareMatch(entry, ast, TableEntry);
- return Texts(fmt_inline(entry->key, comments), "=", fmt_inline(entry->value, comments));
+ if (entry->value) return Texts(fmt_inline(entry->key, comments), ": ", fmt_inline(entry->value, comments));
+ else return Texts(fmt_inline(entry->key, comments));
}
/*inline*/ case Declare: {
DeclareMatch(decl, ast, Declare);
@@ -629,7 +630,8 @@ Text_t format_code(ast_t *ast, Table_t comments, Text_t indent) {
/*multiline*/ case TableEntry: {
if (inlined_fits) return inlined;
DeclareMatch(entry, ast, TableEntry);
- return Texts(fmt(entry->key, comments, indent), ": ", fmt(entry->value, comments, indent));
+ if (entry->value) return Texts(fmt(entry->key, comments, indent), ": ", fmt(entry->value, comments, indent));
+ else return Texts(fmt(entry->key, comments, indent));
}
/*multiline*/ case Declare: {
if (inlined_fits) return inlined;