diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2025-06-28 11:58:55 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-28 11:58:55 +0200 |
| commit | 91d4bc816f63f96a69ac0dd9a36358214c655d68 (patch) | |
| tree | eada9fe1a33920f1cbef5995281d0eb6f7d353a6 /src | |
| parent | d7c08dca5bee9f9ddda7cde4fb5d428251b025a5 (diff) | |
| parent | 39b13197d23073f51b82ba090b8931969037f660 (diff) | |
Merge pull request #681 from stianhj/fix-matrix-trailing-whitespace
fix trailing whitespace in matrix formatting
Diffstat (limited to 'src')
| -rw-r--r-- | src/odin/printer/visit.odin | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/odin/printer/visit.odin b/src/odin/printer/visit.odin index ead0963..13d9a17 100644 --- a/src/odin/printer/visit.odin +++ b/src/odin/printer/visit.odin @@ -1938,7 +1938,11 @@ visit_matrix_comp_lit :: proc(p: ^Printer, comp_lit: ^ast.Comp_Lit, matrix_type: for row := 0; row < row_count; row += 1 { for column := 0; column < column_count; column += 1 { document = cons(document, visit_expr(p, comp_lit.elems[column + row * column_count])) - document = cons(document, text(", ")) + if column_count - 1 != column { + document = cons(document, text(", ")) + } else { + document = cons(document, text(",")) + } } if row_count - 1 != row { |