Skip to content

Commit

Permalink
julefmt: fix match-case scope detection
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Mar 28, 2024
1 parent 2431d87 commit 6f10c7e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/format.jule
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,9 @@ impl Formatter {
self.write("unsafe ")
}
self.write("fn ")
self.write(d.ident)
if !lex::is_anon_ident(d.ident) {
self.write(d.ident)
}
self.generics(d.generics)
self.write("(")
for (i, mut p) in d.params {
Expand Down Expand Up @@ -1066,6 +1068,7 @@ impl ScopeFormatter {
self.fmt.done_indent()
}
self.write(self.fmt.indent)
self.fmt.row = mc.end.row
self.write("}")
}

Expand Down Expand Up @@ -1582,6 +1585,8 @@ impl ExprFormatter {
| &ast::TypeDecl:
let mut t = (&ast::TypeDecl)(kind)
self.fmt.format_type(t)
| &ast::FnDecl:
self.fmt.fn_decl((&ast::FnDecl)(kind))
| &ast::IdentExpr:
self.ident((&ast::IdentExpr)(kind))
| &ast::TupleExpr:
Expand Down

0 comments on commit 6f10c7e

Please sign in to comment.