Skip to content

Commit

Permalink
julefmt: minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Apr 1, 2024
1 parent a6cba7e commit 101fbe9
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/format.jule
Original file line number Diff line number Diff line change
Expand Up @@ -1466,9 +1466,24 @@ impl ExprFormatter {
}

fn unsafexpr(&self, mut u: &ast::UnsafeExpr) {
self.write("unsafe { ")
self.write("unsafe {")
let line = u.expr.token.row != u.expr.end.row
if line {
self.fmt.add_indent()
self.write("\n")
self.write(self.fmt.indent)
} else {
self.write(" ")
}
self.format(u.expr)
self.write(" }")
if line {
self.fmt.done_indent()
self.write("\n")
self.write(self.fmt.indent)
} else {
self.write(" ")
}
self.write("}")
}

fn coexpr(&self, mut c: &ast::CoExpr) {
Expand Down

0 comments on commit 101fbe9

Please sign in to comment.