From c68b7f5c26dc0ee8f162b86a2adcc12eb922d71d Mon Sep 17 00:00:00 2001 From: DanielGavin Date: Sun, 22 Sep 2024 13:40:34 +0200 Subject: [PATCH] Trim file tags for \r --- src/odin/printer/printer.odin | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/odin/printer/printer.odin b/src/odin/printer/printer.odin index 559a4e30..8fb8baf6 100644 --- a/src/odin/printer/printer.odin +++ b/src/odin/printer/printer.odin @@ -210,13 +210,12 @@ print_file :: proc(p: ^Printer, file: ^ast.File) -> string { p.document = empty() for tag in file.tags { - p.document = cons(p.document, text(tag.text), newline(1)) + p.document = cons(p.document, text(strings.trim(tag.text, "\r\n")), newline(1)) pos := tag.pos pos.line += 1 set_source_position(p, pos) } - p.document = cons(p.document, move_line(p, file.pkg_token.pos)) p.document = cons(p.document, cons_with_nopl(text(file.pkg_token.text), text(file.pkg_name)))