diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/odin/printer/visit.odin | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/odin/printer/visit.odin b/src/odin/printer/visit.odin index 0911496..2b0dcd3 100644 --- a/src/odin/printer/visit.odin +++ b/src/odin/printer/visit.odin @@ -243,7 +243,13 @@ visit_decl :: proc(p: ^Printer, decl: ^ast.Decl, called_in_stmt := false) -> ^Do } document = cons(document, text("}")) } else if len(v.fullpaths) == 1 { - document = cons_with_nopl(document, visit_expr(p, v.fullpaths[0])) + if _, ok := v.fullpaths[0].derived_expr.(^ast.Basic_Lit); ok { + document = cons_with_nopl(document, visit_expr(p, v.fullpaths[0])) + } else { + document = cons_with_nopl(document, text("{")) + document = cons(document, visit_expr(p, v.fullpaths[0])) + document = cons(document, text("}")) + } } return document |