← every case · 1000 · comments

1120-close_then_code_then_stray_and_reopen

a block closes, code follows, then a stray close and a real open share a byte

read ascloc.defaultmezura.contentmezura.regionscc.defaulttokei.default
input.c
1codeint w = 8; /* tail
2code*/ int z = 9; */* int y = 10;
3commentshidden by the reopened block
4comments*/

stringcommentthe tag around another language

What each tool answered

cloc.default ✗ fails

the block comment is cut out together with the line break inside it, so the code before the opener and the code after the closer become one line and the line that vanished is charged to comments

the rules ask4 lines · 0 blanks · 2 code · 2 comments
it answers4 lines · 0 blanks · 1 code · 3 comments

cloc --json cases/1000-comments/1120-close_then_code_then_stray_and_reopen/input.c

mezura.content ✓ agrees
the rules ask4 lines · 2 code · 1 comments · 1 extra
it answers4 lines · 2 code · 1 comments · 1 extra

mezura cases/1000-comments/1120-close_then_code_then_stray_and_reopen/input.c --output json --hide timing --counting content

mezura.region ✓ agrees
the rules ask4 lines · 0 blanks · 2 code · 2 comments
it answers4 lines · 0 blanks · 2 code · 2 comments

mezura cases/1000-comments/1120-close_then_code_then_stray_and_reopen/input.c --output json --hide timing --counting region

scc.default ✓ agrees
the rules ask4 lines · 0 blanks · 2 code · 2 comments
it answers4 lines · 0 blanks · 2 code · 2 comments

scc --format json cases/1000-comments/1120-close_then_code_then_stray_and_reopen/input.c

tokei.default ✗ fails

a line that began inside a block is a comment, so the statement after the close is lost

the rules ask4 lines · 0 blanks · 2 code · 2 comments
it answers4 lines · 0 blanks · 1 code · 3 comments

tokei --output json cases/1000-comments/1120-close_then_code_then_stray_and_reopen/input.c