aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-08-26 02:56:51 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-08-26 02:56:51 -0400
commit4715487a4be9f03ad58cb3199e95573e262f6387 (patch)
treef47283c1fb5ec6f1d36302c40fc65671563e1b71
parent5b06702dde3f53510a3d64a8156a349914afa605 (diff)
More termify fixes
-rw-r--r--src/formatter/utils.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/formatter/utils.c b/src/formatter/utils.c
index 37751377..a032ec2f 100644
--- a/src/formatter/utils.c
+++ b/src/formatter/utils.c
@@ -117,7 +117,9 @@ OptionalText_t termify_inline(ast_t *ast, Table_t comments) {
switch (ast->tag) {
case BINOP_CASES:
case Not:
- case Negative: return parenthesize(format_inline_code(ast, comments), EMPTY_TEXT);
+ case Negative:
+ case HeapAllocate:
+ case StackReference: return parenthesize(format_inline_code(ast, comments), EMPTY_TEXT);
default: return format_inline_code(ast, comments);
}
}
@@ -126,7 +128,9 @@ Text_t termify(ast_t *ast, Table_t comments, Text_t indent) {
switch (ast->tag) {
case BINOP_CASES:
case Not:
- case Negative: return parenthesize(format_code(ast, comments, indent), indent);
+ case Negative:
+ case HeapAllocate:
+ case StackReference: return parenthesize(format_code(ast, comments, indent), indent);
default: return format_inline_code(ast, comments);
}
}