diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2025-08-16 11:27:56 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-16 11:27:56 +0200 |
| commit | 1827ea5bf1196e92a576e03e08308233e055f78f (patch) | |
| tree | b577468b4bef97b26b76218bac4e077f91a1ffd7 /src | |
| parent | ea6f799f8aad4fd43ee65a34943e9e6a358a378d (diff) | |
| parent | 1c7827701a2188c681e080138ebd2fb0431d4b46 (diff) | |
Merge pull request #877 from BradLewis/feat/formatting-empty-struct-literals
Remove space when formatting empty struct literals used as values
Diffstat (limited to 'src')
| -rw-r--r-- | src/odin/printer/visit.odin | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/odin/printer/visit.odin b/src/odin/printer/visit.odin index 55835f1..9784052 100644 --- a/src/odin/printer/visit.odin +++ b/src/odin/printer/visit.odin @@ -1619,8 +1619,11 @@ visit_expr :: proc( if v.fields != nil && len(v.fields.list) == 0 { - - document = cons_with_nopl(document, text("{")) + if called_from == .Generic { + document = cons(document, text("{")) + } else { + document = cons_with_nopl(document, text("{")) + } if contains_comments_in_range(p, v.pos, v.end) { comments, _ := visit_comments(p, v.end) |