← every case · 5000 · line splices

5030-line_splice_inside_a_comment

a backslash at the end of a line comment continues it onto the next line in C

read ascloc.defaultmezura.contentmezura.regionscc.defaulttokei.default
input.c
1comments// this comment continues \
2comments onto the next line in C
3codeint x = 1;

stringcommentthe tag around another language

What each tool answered

cloc.default ✗ fails

a line comment stops at the line break whatever the line ends with, so the line spliced onto it counts as code

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

cloc --json cases/5000-line_splices/5030-line_splice_inside_a_comment/input.c

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

mezura cases/5000-line_splices/5030-line_splice_inside_a_comment/input.c --output json --hide timing --counting content

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

mezura cases/5000-line_splices/5030-line_splice_inside_a_comment/input.c --output json --hide timing --counting region

scc.default ✗ fails

the comment ends at the newline, so the line joined to it is counted as code

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

scc --format json cases/5000-line_splices/5030-line_splice_inside_a_comment/input.c

tokei.default ✗ fails

the comment ends at the newline, so the line joined to it is counted as code

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

tokei --output json cases/5000-line_splices/5030-line_splice_inside_a_comment/input.c