diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-08-13 20:19:52 -0400 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-08-13 20:19:52 -0400 |
| commit | 1c7827701a2188c681e080138ebd2fb0431d4b46 (patch) | |
| tree | 44fda65416e3b25168ec45881c056d72d38f5871 /src | |
| parent | d7761dc6f842d15496cbf746ce90cb84b3bf5b37 (diff) | |
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 0f3f691..2a8fe46 100644 --- a/src/odin/printer/visit.odin +++ b/src/odin/printer/visit.odin @@ -1617,8 +1617,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) |