Skip to content

Commit

Permalink
julefmt: refactor with julefmt
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Sep 27, 2024
1 parent df43825 commit 1e6ca0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/comment.jule
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions src/format.jule
Original file line number Diff line number Diff line change
Expand Up @@ -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--
Expand Down Expand Up @@ -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--
Expand Down Expand Up @@ -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(" ")
}
Expand Down

0 comments on commit 1e6ca0f

Please sign in to comment.