diff options
| author | Laytan Laats <laytanlaats@hotmail.com> | 2024-08-31 00:46:07 +0200 |
|---|---|---|
| committer | Laytan Laats <laytanlaats@hotmail.com> | 2024-08-31 00:46:07 +0200 |
| commit | 5a17ec35bd8859a954931c22634ef538e44d3735 (patch) | |
| tree | fa8584b718bd0066f1c79384bd95f235c0063006 /src | |
| parent | 8841c68bcc33ba9bca30ae3508e23bd49cf06ee5 (diff) | |
fix removing imports at the end of the file
Diffstat (limited to 'src')
| -rw-r--r-- | src/odin/printer/printer.odin | 5 |
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 |