← every case · 2000 · string forms
a Rust raw string, opened with r#" and closed with "#, so the plain quote written inside it is text and closes nothing. A counter that ends the string at that quote reads the /* after it as a comment opener. 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
| 1 | codecodecodecodecodecodecode | let a = r#"say "hi /* and stay code"#; |
| 2 | codecodecodecodecodecodecode | let b = 1; |
| 3 | commentscommentscommentscommentscommentscommentscomments | // a real comment */ |
stringcommentthe tag around another language
the /* inside the raw string is read as a comment opener, as it is inside a plain string too, and the */ at the end of the last line closes it, so the line of code between them counts as a comment
cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2130-raw_string_holding_quotes/input.rs
--strip-str-comments
Rust has no raw string here, so the string ends at the plain quote inside it and the /* after that quote opens a comment, which the */ at the end of the last line closes
cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2130-raw_string_holding_quotes/input.rs --strip-str-comments
the /* inside the raw string is read as a comment opener, as it is inside a plain string too, and the */ at the end of the last line closes it, so the line of code between them counts as a comment
cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2130-raw_string_holding_quotes/input.rs --docstring-as-code
codestats cases/2000-string_forms/2130-raw_string_holding_quotes/input.rs --output json-compact --include-generated --no-gitignore --hidden --no-config
mezura cases/2000-string_forms/2130-raw_string_holding_quotes/input.rs --output json --hide timing --no-default-config --no-local --counting content
mezura cases/2000-string_forms/2130-raw_string_holding_quotes/input.rs --output json --hide timing --no-default-config --no-local --counting region
scc --format json --no-config cases/2000-string_forms/2130-raw_string_holding_quotes/input.rs
tokei --output json cases/2000-string_forms/2130-raw_string_holding_quotes/input.rs