Skip to content

Commit 86c115b

Browse files
committed
julefmt: update code style
1 parent c66d622 commit 86c115b

File tree

3 files changed

+703
-704
lines changed

3 files changed

+703
-704
lines changed

src/comment.jule

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,40 @@ use std::jule::lex::{
77
TokenId,
88
}
99

10-
struct Comment {
10+
struct comment {
1111
row: int
1212
col: int
1313
txt: str
1414
}
1515

16-
struct CommentMap {
17-
map: []&Comment
16+
struct commentMap {
17+
map: []&comment
1818
}
1919

20-
impl CommentMap {
21-
static fn build(mut &tokens: []&Token): CommentMap {
22-
let mut cm = CommentMap{
23-
map: make([]&Comment, 0, 1 << 8),
20+
impl commentMap {
21+
static fn build(mut &tokens: []&Token): commentMap {
22+
let mut cm = commentMap{
23+
map: make([]&comment, 0, 1 << 8),
2424
}
2525
let mut i = 0
2626
for i < tokens.len {
2727
let token = tokens[i]
28-
if token.id != TokenId.Comment {
28+
if token.Id != TokenId.Comment {
2929
i++
3030
continue
3131
}
32-
cm.map = append(cm.map, &Comment{
33-
row: token.row,
34-
col: token.column,
35-
txt: token.kind,
32+
cm.map = append(cm.map, &comment{
33+
row: token.Row,
34+
col: token.Column,
35+
txt: token.Kind,
3636
})
3737
_ = copy(tokens[i:], tokens[i+1:])
3838
tokens = tokens[:tokens.len-1]
3939
}
4040
ret cm
4141
}
4242

43-
fn first(mut self, row: int): &Comment {
43+
fn first(mut self, row: int): &comment {
4444
if self.map.len == 0 {
4545
ret nil
4646
}
@@ -51,19 +51,19 @@ impl CommentMap {
5151
ret c
5252
}
5353

54-
fn drop_first(mut self) {
54+
fn dropFirst(mut self) {
5555
self.map = self.map[1:]
5656
}
5757

58-
fn pop(mut self, row: int): &Comment {
58+
fn pop(mut self, row: int): &comment {
5959
if self.map.len == 0 {
6060
ret nil
6161
}
6262
let mut c = self.map[0]
6363
if c.row > row {
6464
ret nil
6565
}
66-
self.drop_first()
66+
self.dropFirst()
6767
ret c
6868
}
6969
}

0 commit comments

Comments
 (0)