← every case · 2000 · string forms

2040-comment_pair_opening_inside_a_string

a block comment opener inside a string opens nothing. The file ends with a block comment of its own, so a comment opened there by mistake has a closer to reach, and a counter that ignores an opener nobody closes cannot pass by accident

read ascloc.defaultcloc.docstring-as-codecodestats.defaultmezura.contentmezura.regionscc.defaulttokei.default
input.c
1codechar *s = "/*";
2codeint x = 1;
3comments/* a real comment */

stringcommentthe tag around another language

What each tool answered

cloc.default ✗ fails

the /* inside the string "/*" is read as a comment opener, and the comment ending the file closes it, so the code line between counts as comment

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

cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2040-comment_pair_opening_inside_a_string/input.c

cloc.default ✓ agrees

--strip-str-comments

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

cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2040-comment_pair_opening_inside_a_string/input.c --strip-str-comments

cloc.docstring-as-code ✗ fails

the /* inside the string "/*" is read as a comment opener, and the comment ending the file closes it, so the code line between counts as comment

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

cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2040-comment_pair_opening_inside_a_string/input.c --docstring-as-code

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

codestats cases/2000-string_forms/2040-comment_pair_opening_inside_a_string/input.c --output json-compact --include-generated --no-gitignore --hidden --no-config

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

mezura cases/2000-string_forms/2040-comment_pair_opening_inside_a_string/input.c --output json --hide timing --no-default-config --no-local --counting content

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

mezura cases/2000-string_forms/2040-comment_pair_opening_inside_a_string/input.c --output json --hide timing --no-default-config --no-local --counting region

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

scc --format json --no-config cases/2000-string_forms/2040-comment_pair_opening_inside_a_string/input.c

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

tokei --output json cases/2000-string_forms/2040-comment_pair_opening_inside_a_string/input.c