diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-08-26 16:57:13 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-08-26 16:57:13 -0400 |
| commit | bc619548d87c1a7c588998a76719f85a7c809306 (patch) | |
| tree | 95e439581606d740e97e74880a97ef389641ecd2 /src/formatter/formatter.c | |
| parent | 76aac20d8ed7482f4ee7f3b3a69e3e08138251fa (diff) | |
Add extern formatter
Diffstat (limited to 'src/formatter/formatter.c')
| -rw-r--r-- | src/formatter/formatter.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/formatter/formatter.c b/src/formatter/formatter.c index 64158876..07974e3c 100644 --- a/src/formatter/formatter.c +++ b/src/formatter/formatter.c @@ -46,6 +46,7 @@ OptionalText_t format_inline_code(ast_t *ast, Table_t comments) { /*inline*/ case FunctionDef: /*inline*/ case ConvertDef: /*inline*/ case DocTest: + /*inline*/ case Extern: return NONE_TEXT; /*inline*/ case Assert: { DeclareMatch(assert, ast, Assert); @@ -461,7 +462,11 @@ Text_t format_code(ast_t *ast, Table_t comments, Text_t indent) { DeclareMatch(extend, ast, Extend); return Texts("lang ", Text$from_str(extend->name), format_namespace(extend->body, comments, indent)); } - /*inline*/ case Defer: + /*multiline*/ case Extern: { + DeclareMatch(ext, ast, Extern); + return Texts("extern ", Text$from_str(ext->name), " : ", format_type(ext->type)); + } + /*multiline*/ case Defer: return Texts("defer ", format_namespace(Match(ast, Defer)->body, comments, indent)); /*multiline*/ case List: /*multiline*/ case Set: { |
