← 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

read ascloc.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 cases/5000-line_splices/5020-blank_line_inside_a_spliced_string/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/5000-line_splices/5020-blank_line_inside_a_spliced_string/input.c --output json --hide timing --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 --counting region

scc.default ✗ fails

the string is carried past the blank line, so the comment line is counted as code

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

scc --format json 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