diff options
| author | Vasil Bozhurski <vasil.bozhurski@sap.com> | 2025-02-08 21:03:58 +0200 |
|---|---|---|
| committer | Vasil Bozhurski <vasil.bozhurski@sap.com> | 2025-02-08 21:03:58 +0200 |
| commit | 2cdf6ecc3bd8290043b79079dec4929cdb540716 (patch) | |
| tree | f3cde82dfda9489caeadd7912830dbd062f7508d /src | |
| parent | 94822db4b5dd90c39020fb48f89532e0f44e7110 (diff) | |
do not overwrite brackets for foreign import
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 |