← every case · 5000 · line splices

5060-code_then_a_spliced_line_comment

a line holding real code ends in a spliced line comment, so the next two lines belong to that comment in C. The splice is written twice on purpose: a counter that joins a spliced line onto the one above and counts it as code gets a single splice right by accident, since the line above is code already and the line it took away is counted as a comment

read ascloc.defaultcloc.docstring-as-codecodestats.defaultmezura.contentmezura.regionscc.defaulttokei.default
input.c
1codeint a = 1; // comment \
2comments continued \
3comments joined to the comment
4codeint x = 1;

stringcommentthe tag around another language

What each tool answered

cloc.default ✗ fails

the comment takes its line break with it and stops there, so the first spliced line is joined to the code line above it and the second counts as code. A single splice comes out right by accident, since what it joins lands on a line that is code already

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

cloc --json --config /tmp/linejudge-empty-file cases/5000-line_splices/5060-code_then_a_spliced_line_comment/input.c

cloc.default ✗ fails

--strip-str-comments

the comment takes its line break with it and stops there, so the first spliced line is joined to the code line above it and the second counts as code. A single splice comes out right by accident, since what it joins lands on a line that is code already

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

cloc --json --config /tmp/linejudge-empty-file cases/5000-line_splices/5060-code_then_a_spliced_line_comment/input.c --strip-str-comments

cloc.docstring-as-code ✗ fails

the comment takes its line break with it and stops there, so the first spliced line is joined to the code line above it and the second counts as code. A single splice comes out right by accident, since what it joins lands on a line that is code already

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

cloc --json --config /tmp/linejudge-empty-file cases/5000-line_splices/5060-code_then_a_spliced_line_comment/input.c --docstring-as-code

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

codestats cases/5000-line_splices/5060-code_then_a_spliced_line_comment/input.c --output json-compact --include-generated --no-gitignore --hidden --no-config

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/5060-code_then_a_spliced_line_comment/input.c --output json --hide timing --no-default-config --no-local --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/5060-code_then_a_spliced_line_comment/input.c --output json --hide timing --no-default-config --no-local --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 --no-config cases/5000-line_splices/5060-code_then_a_spliced_line_comment/input.c

tokei.default ✗ fails

the comment ends at the newline, so both lines joined to it are counted as code

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/5060-code_then_a_spliced_line_comment/input.c