← every case · 5000 · line splices

5050-line_splice_after_a_closed_block_comment

a block comment closes and a line comment opens on the same line, with a space between the two. That space is not code, so the splice ending the line still carries the comment on

read ascloc.defaultmezura.contentmezura.regionscc.defaulttokei.default
input.c
1codeint a = 1;
2comments/* block */ // trailing \
3commentsint x = 1;
4codeint y = 2;

stringcommentthe tag around another language

What each tool answered

cloc.default ✗ fails

a block comment closing earlier on the line does not move where the line comment after it stops, which is still the line break, so the line spliced onto it counts as code

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

cloc --json cases/5000-line_splices/5050-line_splice_after_a_closed_block_comment/input.c

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

mezura cases/5000-line_splices/5050-line_splice_after_a_closed_block_comment/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/5000-line_splices/5050-line_splice_after_a_closed_block_comment/input.c --output json --hide timing --counting region

scc.default ✗ fails

the line with the two comments on it is read correctly and the splice is not, so the line joined to the comment counts as code

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

scc --format json cases/5000-line_splices/5050-line_splice_after_a_closed_block_comment/input.c

tokei.default ✗ fails

two faults on one line, so it loses two. The line reads as code, which case 1070 holds on its own, and the splice does not carry, which case 5030 holds

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

tokei --output json cases/5000-line_splices/5050-line_splice_after_a_closed_block_comment/input.c