Skip to content

Commit

Permalink
done
Browse files Browse the repository at this point in the history
  • Loading branch information
trdthg committed Aug 9, 2024
1 parent 2bb72e7 commit 534d7ac
Show file tree
Hide file tree
Showing 13 changed files with 404 additions and 138 deletions.
8 changes: 8 additions & 0 deletions sail_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"fmt": {
"indent": 2,
"preserve_structure": false,
"line_width": 120,
"ribbon_width": 1.0
}
}
23 changes: 20 additions & 3 deletions src/lib/chunk_ast.ml
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,14 @@ let rec pop_header_comments comments chunks l lnum =
| Some (s, _) when e.pos_cnum < s.pos_cnum && comment_s.pos_lnum = lnum ->
let _ = Stack.pop comments in
Queue.add
(Comment (comment_type, 0, comment_s.pos_cnum - comment_s.pos_bol, contents, e.pos_lnum == lnum))
(Comment
( comment_type,
0,
comment_s.pos_cnum - comment_s.pos_bol,
contents,
comment_type = Lexer.Comment_line && e.pos_lnum == lnum
)
)
chunks;
Queue.add (Spacer (true, 1)) chunks;
pop_header_comments comments chunks l (lnum + 1)
Expand All @@ -444,7 +451,12 @@ let rec pop_comments ?(spacer = true) comments chunks l =
let _ = Stack.pop comments in
Queue.add
(Comment
(comment_type, 0, comment_s.pos_cnum - comment_s.pos_bol, contents, comment_s.pos_lnum == e.pos_lnum)
( comment_type,
0,
comment_s.pos_cnum - comment_s.pos_bol,
contents,
comment_type = Lexer.Comment_line && comment_s.pos_lnum == e.pos_lnum
)
)
chunks;
if spacer && comment_e.pos_lnum < s.pos_lnum then Queue.add (Spacer (true, 1)) chunks;
Expand All @@ -461,7 +473,12 @@ let rec pop_comments_until_loc_end comments chunks l =
let _ = Stack.pop comments in
Queue.add
(Comment
(comment_type, 0, comment_s.pos_cnum - comment_s.pos_bol, contents, comment_s.pos_lnum == e.pos_lnum)
( comment_type,
0,
comment_s.pos_cnum - comment_s.pos_bol,
contents,
comment_type = Lexer.Comment_line && comment_s.pos_lnum == e.pos_lnum
)
)
chunks;
pop_comments_until_loc_end comments chunks l
Expand Down
Loading

0 comments on commit 534d7ac

Please sign in to comment.