aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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);
}
}