← every case · 5000 · line splices

5020-blank_line_inside_a_spliced_string

the splice carries a string only off a line ending in a backslash, and the blank line does not, so the string is over before the comment line. Case 5010 is its other half: a counter that never sees a splice and ends its strings with the line is caught there, and one that never sees a splice and lets its strings run across lines is caught here

read ascloc.defaultcloc.docstring-as-codecodestats.defaultmezura.contentmezura.regionscc.defaulttokei.default
input.c
1codechar *s = "abc \
2blanks
3comments// a comment once the string has ended";
4codeint x = 1;

stringcommentthe tag around another language

What each tool answered

cloc.default ✗ fails

a blank line under a line ending in the language's continuation symbol is read as continuing it and is never blank, so the blank inside the spliced string comes out code

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

cloc --json --config /tmp/linejudge-empty-file cases/5000-line_splices/5020-blank_line_inside_a_spliced_string/input.c

cloc.default ✗ fails

--strip-str-comments

a blank line under a line ending in the language's continuation symbol is read as continuing it and is never blank, so the blank inside the spliced string comes out code

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

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

cloc.docstring-as-code ✗ fails

a blank line under a line ending in the language's continuation symbol is read as continuing it and is never blank, so the blank inside the spliced string comes out code

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

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

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

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

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

mezura cases/5000-line_splices/5020-blank_line_inside_a_spliced_string/input.c --output json --hide timing --no-default-config --no-local --counting content

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

mezura cases/5000-line_splices/5020-blank_line_inside_a_spliced_string/input.c --output json --hide timing --no-default-config --no-local --counting region

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

scc --format json --no-config cases/5000-line_splices/5020-blank_line_inside_a_spliced_string/input.c

tokei.default ✓ agrees
the rules ask4 lines · 0 blanks · 3 code · 1 comments
it answers4 lines · 0 blanks · 3 code · 1 comments

tokei --output json cases/5000-line_splices/5020-blank_line_inside_a_spliced_string/input.c