diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2021-04-18 22:06:32 +0200 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2021-04-18 22:06:32 +0200 |
| commit | f7b8b3a3400a28c4f35a6e10885bb0f0142441c8 (patch) | |
| tree | f15fc6b52a18529955352c4638d78f874a6fe547 | |
| parent | 2cbb3443d3051bea25dff8b1028c5ec6f71f3c0f (diff) | |
ensure that the comments gets pushed if it's in the beginning before package
| -rw-r--r-- | core/odin/printer/printer.odin | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/odin/printer/printer.odin b/core/odin/printer/printer.odin index 928c0e07d..600f0bfe3 100644 --- a/core/odin/printer/printer.odin +++ b/core/odin/printer/printer.odin @@ -123,6 +123,8 @@ print :: proc(p: ^Printer, file: ^ast.File) -> string { p.lines = make([dynamic]Line, 0, (file.decls[len(file.decls) - 1].end.line - file.decls[0].pos.line) * 2, context.temp_allocator);
}
+ set_source_position(p, file.pkg_token.pos);
+
set_line(p, 0);
push_generic_token(p, .Package, 0);
@@ -514,7 +516,7 @@ align_switch_stmt :: proc(p: ^Printer, index: int) { //this will only happen if the case is one lined
if case_found && colon_found {
- line.format_tokens[i].spaces_before = (largest - length);
+ line.format_tokens[i].spaces_before = (largest - length) + 1;
break;
}
|