← every case · 1000 · comments

1150-doc_comment_opening_after_code

a doc comment that opens on a line which already holds code. The line is code, and the block of documentation that begins on it does not begin at its first character

read ascloc.defaultmezura.contentmezura.regionscc.defaulttokei.default
input.rs
1codeconst NAME: &str = "mezura"; /// A documented function.
2comments/// The paragraph after it.
3codefn documented() {}

stringcommentthe tag around another language

What each tool answered

cloc.default ✓ agrees
the rules ask3 lines · 0 blanks · 2 code · 1 comments
it answers3 lines · 0 blanks · 2 code · 1 comments

cloc --json cases/1000-comments/1150-doc_comment_opening_after_code/input.rs

mezura.content ✓ agrees
the rules ask3 lines · 2 code · 1 comments · 0 extra
it answers3 lines · 2 code · 1 comments · 0 extra

mezura cases/1000-comments/1150-doc_comment_opening_after_code/input.rs --output json --hide timing --counting content

mezura.region ✓ agrees
the rules ask3 lines · 0 blanks · 2 code · 1 comments
it answers3 lines · 0 blanks · 2 code · 1 comments

mezura cases/1000-comments/1150-doc_comment_opening_after_code/input.rs --output json --hide timing --counting region

scc.default ✓ agrees
the rules ask3 lines · 0 blanks · 2 code · 1 comments
it answers3 lines · 0 blanks · 2 code · 1 comments

scc --format json cases/1000-comments/1150-doc_comment_opening_after_code/input.rs

tokei.default ✗ fails

the whole of the first line is given to the documentation, so the code in front of the doc marker is counted as a comment and lands in the Markdown block instead of in Rust

the rules ask3 lines · 0 blanks · 2 code · 1 comments · Markdown 2
it answers3 lines · 0 blanks · 1 code · 2 comments · Markdown 2

tokei --output json cases/1000-comments/1150-doc_comment_opening_after_code/input.rs