aboutsummaryrefslogtreecommitdiff
path: root/src/formatter/formatter.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-08-25 23:59:09 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-08-25 23:59:09 -0400
commit978835e3dd8dd59a1efaa869f2f603eb9eea5a3f (patch)
tree112078680658abcb9d9fa310e2f8c8553d0fa40b /src/formatter/formatter.h
parent91b6746fe1315aa9c09936b69cea3892c04c11af (diff)
Split out utility functions
Diffstat (limited to 'src/formatter/formatter.h')
-rw-r--r--src/formatter/formatter.h19
1 files changed, 3 insertions, 16 deletions
diff --git a/src/formatter/formatter.h b/src/formatter/formatter.h
index 83bb9e56..a8f9013a 100644
--- a/src/formatter/formatter.h
+++ b/src/formatter/formatter.h
@@ -2,25 +2,12 @@
#pragma once
+#include <stdbool.h>
+
#include "../ast.h"
#include "../stdlib/datatypes.h"
-#define MAX_WIDTH 100
-
-#define must(expr) \
- ({ \
- OptionalText_t _expr = expr; \
- if (_expr.length < 0) return NONE_TEXT; \
- (Text_t) _expr; \
- })
-
-extern const Text_t single_indent;
-
Text_t format_file(const char *path);
Text_t format_code(ast_t *ast, Table_t comments, Text_t indentation);
+Text_t format_namespace(ast_t *namespace, Table_t comments, Text_t indent);
OptionalText_t format_inline_code(ast_t *ast, Table_t comments);
-
-OptionalText_t next_comment(Table_t comments, const char **pos, const char *end);
-bool range_has_comment(const char *start, const char *end, Table_t comments);
-OptionalText_t next_comment(Table_t comments, const char **pos, const char *end);
-void add_line(Text_t *code, Text_t line, Text_t indent);