← every case · 2000 · string forms

2025-raw_opener_inside_a_comment

a Rust raw string opener written inside a block comment. Its closing symbol is "#, so a counter that pairs it with the next quote it meets loses the real string later on the same line, and the /* inside that string then opens a comment of its own. The raw string on the line below holds one quote and a /* after it, so a counter with no raw string form cannot pass this file either, whether its strings end with their line or run across it. The file ends with a line comment holding */, so a block comment left open by a mistake earlier has a closer to reach whether the counter nests block comments or not, 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.rs
1code/* r#" opens a raw string */ let s = "/*";
2codelet text = r#"the " /* character"#;
3codelet y = 1;
4comments// a real comment
5comments// a second real comment
6comments// a third 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 */ at the end of the last line closes it, so the two lines of code between them count as comments

the rules ask6 lines · 0 blanks · 3 code · 3 comments
it answers6 lines · 0 blanks · 1 code · 5 comments

cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2025-raw_opener_inside_a_comment/input.rs

cloc.default ✗ fails

--strip-str-comments

the quote of the r#" inside the block comment pairs with the first quote of "/*", the comment's own closer between them is stripped as the content of a string, and the comment then runs from the first line to the */ at the end of the last line

the rules ask6 lines · 0 blanks · 3 code · 3 comments
it answers6 lines · 0 blanks · 0 code · 6 comments

cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2025-raw_opener_inside_a_comment/input.rs --strip-str-comments

cloc.docstring-as-code ✗ fails

the /* inside the string "/*" is read as a comment opener, and the */ at the end of the last line closes it, so the two lines of code between them count as comments

the rules ask6 lines · 0 blanks · 3 code · 3 comments
it answers6 lines · 0 blanks · 1 code · 5 comments

cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2025-raw_opener_inside_a_comment/input.rs --docstring-as-code

codestats.default ✓ agrees
the rules ask6 lines · 0 blanks · 3 code · 3 comments
it answers6 lines · 0 blanks · 3 code · 3 comments

codestats cases/2000-string_forms/2025-raw_opener_inside_a_comment/input.rs --output json-compact --include-generated --no-gitignore --hidden --no-config

mezura.content ✓ agrees
the rules ask6 lines · 3 code · 3 comments · 0 extra
it answers6 lines · 3 code · 3 comments · 0 extra

mezura cases/2000-string_forms/2025-raw_opener_inside_a_comment/input.rs --output json --hide timing --no-default-config --no-local --counting content

mezura.region ✓ agrees
the rules ask6 lines · 0 blanks · 3 code · 3 comments
it answers6 lines · 0 blanks · 3 code · 3 comments

mezura cases/2000-string_forms/2025-raw_opener_inside_a_comment/input.rs --output json --hide timing --no-default-config --no-local --counting region

scc.default ✓ agrees
the rules ask6 lines · 0 blanks · 3 code · 3 comments
it answers6 lines · 0 blanks · 3 code · 3 comments

scc --format json --no-config cases/2000-string_forms/2025-raw_opener_inside_a_comment/input.rs

tokei.default ✓ agrees
the rules ask6 lines · 0 blanks · 3 code · 3 comments
it answers6 lines · 0 blanks · 3 code · 3 comments

tokei --output json cases/2000-string_forms/2025-raw_opener_inside_a_comment/input.rs