Skip to content

Commit

Permalink
fix function formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Mar 21, 2024
1 parent ecb4ce4 commit 7524c0a
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/format.jule
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// license that can be found in the LICENSE file.

use ast for std::jule::ast::{Ast}
use lex for std::jule::lex
use strings for std::strings

struct Formatter {
Expand Down Expand Up @@ -96,14 +97,19 @@ impl Formatter {
for i, p in d.params {
if p.mutable {
self.buf += "mut "
if d.reference {
self.buf += "&"
}
if d.ident != "" {
self.buf += d.ident
self.buf += ": "
}
// PARSE_TYPE
}
if p.reference {
self.buf += "&"
}
if !lex::is_anon_ident(p.ident) {
self.buf += p.ident
self.buf += ": "
} else if p.reference {
self.buf += "_: "
}
// PARSE_TYPE
if i + 1 < d.params.len {
self.buf += ", "
}
}
self.buf += ")"
Expand Down

0 comments on commit 7524c0a

Please sign in to comment.