aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaytan Laats <laytanlaats@hotmail.com>2024-08-31 00:46:07 +0200
committerLaytan Laats <laytanlaats@hotmail.com>2024-08-31 00:46:07 +0200
commit5a17ec35bd8859a954931c22634ef538e44d3735 (patch)
treefa8584b718bd0066f1c79384bd95f235c0063006 /src
parent8841c68bcc33ba9bca30ae3508e23bd49cf06ee5 (diff)
fix removing imports at the end of the file
Diffstat (limited to 'src')
-rw-r--r--src/odin/printer/printer.odin5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/odin/printer/printer.odin b/src/odin/printer/printer.odin
index 73a544e..b71eab0 100644
--- a/src/odin/printer/printer.odin
+++ b/src/odin/printer/printer.odin
@@ -242,6 +242,11 @@ print_file :: proc(p: ^Printer, file: ^ast.File) -> string {
}
}
+ // If the file ends with imports.
+ if import_group_start != nil {
+ print_sorted_imports(p, file.decls[import_group_start.?:])
+ }
+
if len(p.comments) > 0 {
infinite := p.comments[len(p.comments) - 1].end
infinite.offset = 9999999