From 1e6ca0f06fd168f84bfa4d14136b1cf57aa9d78d Mon Sep 17 00:00:00 2001 From: mertcandav Date: Fri, 27 Sep 2024 17:05:24 +0300 Subject: [PATCH] julefmt: refactor with julefmt --- src/comment.jule | 2 +- src/format.jule | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/comment.jule b/src/comment.jule index 1a6e9a8..786c778 100644 --- a/src/comment.jule +++ b/src/comment.jule @@ -20,7 +20,7 @@ struct commentMap { impl commentMap { static fn build(mut &tokens: []&Token): commentMap { mut cm := commentMap{ - buf: make([]&comment, 0, 1 << 8), + buf: make([]&comment, 0, 1<<8), } mut i := 0 for i < len(tokens) { diff --git a/src/format.jule b/src/format.jule index c65048f..66c7a12 100644 --- a/src/format.jule +++ b/src/format.jule @@ -774,7 +774,7 @@ impl formatter { } if n > 0 { self.popRowCommentsByF(row, -1, fn(c: &comment) { - self.write(strings::Repeat(" ", paddingAbs(max - utf8::RuneCount(line)) + 1)) + self.write(strings::Repeat(" ", paddingAbs(max-utf8::RuneCount(line))+1)) self.writeComment(c) }) n-- @@ -857,7 +857,7 @@ impl formatter { } if n > 0 { self.popRowCommentsByF(row, -1, fn(c: &comment) { - self.write(strings::Repeat(" ", paddingAbs(max - utf8::RuneCount(line)) + 1)) + self.write(strings::Repeat(" ", paddingAbs(max-utf8::RuneCount(line))+1)) self.writeComment(c) }) n-- @@ -1975,7 +1975,7 @@ impl exprFormatter { self.fmt.buf.Write(expr) self.fmt.popRowCommentsByF(erow.row, col, fn(c: &comment) { if erow.max { - self.write(strings::Repeat(" ", paddingAbs(max - utf8::RuneCount(expr)) + 1)) + self.write(strings::Repeat(" ", paddingAbs(max-utf8::RuneCount(expr))+1)) } else { self.write(" ") }