diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-08-29 14:04:55 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-08-29 14:04:55 -0400 |
| commit | 2d3021728bf5c74f8bf6854c1ae4951a6ebbf9c7 (patch) | |
| tree | 3da6684c56138432b4313856bdce17706e3ec216 /src/formatter/utils.c | |
| parent | 0e67c79f6fc05e79749c2a007df459f926d3dba4 (diff) | |
Formatting tweaks/fixes
Diffstat (limited to 'src/formatter/utils.c')
| -rw-r--r-- | src/formatter/utils.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/formatter/utils.c b/src/formatter/utils.c index 084a6667..1f4e64d8 100644 --- a/src/formatter/utils.c +++ b/src/formatter/utils.c @@ -38,7 +38,7 @@ bool range_has_comment(const char *start, const char *end, Table_t comments) { return (comment.length >= 0); } -CONSTFUNC bool should_have_blank_line(ast_t *ast) { +CONSTFUNC int suggested_blank_lines(ast_t *ast) { switch (ast->tag) { case If: case When: @@ -46,14 +46,15 @@ CONSTFUNC bool should_have_blank_line(ast_t *ast) { case While: case For: case Block: - case FunctionDef: + case Defer: return 1; + case Use: return 1; + case ConvertDef: + case FunctionDef: return 1; case StructDef: case EnumDef: case LangDef: - case ConvertDef: - case Extend: - case Defer: return true; - default: return false; + case Extend: return 2; + default: return 0; } } |
