← every case · 1000 · comments

1220-nested_block_comment_in_odin

Odin block comments nest, so the first closer ends only the inner one and the text under it is still inside the outer block

read ascloc.defaultmezura.contentmezura.regionscc.defaulttokei.default
input.odin
1codepackage main
2comments/* outer
3comments /* inner */
4comments still a comment
5comments*/
6codex := 1

stringcommentthe tag around another language

What each tool answered

cloc.default ✗ fails

the inner closer ends the comment although Odin's pair nests, so the lines under it up to and including the outer closer are left as code

the rules ask6 lines · 0 blanks · 2 code · 4 comments
it answers6 lines · 0 blanks · 4 code · 2 comments

cloc --json cases/1000-comments/1220-nested_block_comment_in_odin/input.odin

mezura.content ✓ agrees
the rules ask6 lines · 2 code · 3 comments · 1 extra
it answers6 lines · 2 code · 3 comments · 1 extra

mezura cases/1000-comments/1220-nested_block_comment_in_odin/input.odin --output json --hide timing --counting content

mezura.region ✓ agrees
the rules ask6 lines · 0 blanks · 2 code · 4 comments
it answers6 lines · 0 blanks · 2 code · 4 comments

mezura cases/1000-comments/1220-nested_block_comment_in_odin/input.odin --output json --hide timing --counting region

scc.default ✗ fails

the block is ended at the inner closer, so the two lines after it are counted as code

the rules ask6 lines · 0 blanks · 2 code · 4 comments
it answers6 lines · 0 blanks · 4 code · 2 comments

scc --format json cases/1000-comments/1220-nested_block_comment_in_odin/input.odin

tokei.default ✗ fails

the block is ended at the inner closer, so the two lines after it are counted as code

the rules ask6 lines · 0 blanks · 2 code · 4 comments
it answers6 lines · 0 blanks · 4 code · 2 comments

tokei --output json cases/1000-comments/1220-nested_block_comment_in_odin/input.odin