Skip to content

Commit

Permalink
Handle empty lines after * prefix in doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Alasdair committed Apr 25, 2024
1 parent b1a6a68 commit c206d72
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib/lexer.mll
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,12 @@ and doc_comment pos b depth lstart = parse
doc_comment pos b (depth - 1) false lexbuf
) }
| "\n" { Buffer.add_string b "\n"; Lexing.new_line lexbuf; doc_comment pos b depth true lexbuf }
| wsc+ "*\n" as prefix { if lstart then (
Buffer.add_string b "\n";
doc_comment pos b depth true lexbuf
) else (
Buffer.add_string b prefix; doc_comment pos b depth true lexbuf
) }
| wsc+ "*" wsc as prefix { if lstart then (
Buffer.add_string b (String.make (String.length prefix - 3) ' ');
doc_comment pos b depth false lexbuf
Expand Down

0 comments on commit c206d72

Please sign in to comment.