← every case · 4000 · a quote that opens nothing
an apostrophe inside a comment, in the word don't, two lines above a real character literal. The apostrophe is text there and pairs with nothing, so a counter pairing it with the literal's own quote swallows every line between them. The block comment further down holds it's and carries code after it closes, which is the same trap on one line. The literal holds a double quote, so a counter with no character literal form whose strings run across lines opens a string there and cannot pass this file either. 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 | commentscommentscommentscommentscommentscommentscomments | // don't change the quote below |
| 2 | commentscommentscommentscommentscommentscommentscomments | // the line under this one is code |
| 3 | codecodecodecodecodecodecode | let c = '"'; |
| 4 | codecodecodecodecodecodecode | /* it's fine as it is */ let d = 'x'; |
| 5 | codecodecodecodecodecodecode | let y = 1; |
| 6 | commentscommentscommentscommentscommentscommentscomments | // a real comment |
| 7 | commentscommentscommentscommentscommentscommentscomments | // a second real comment |
| 8 | commentscommentscommentscommentscommentscommentscomments | // a third real comment */ |
stringcommentthe tag around another language
cloc --json --config /tmp/linejudge-empty-file cases/4000-a_quote_that_opens_nothing/4055-apostrophe_inside_a_comment/input.rs
--strip-str-comments
cloc --json --config /tmp/linejudge-empty-file cases/4000-a_quote_that_opens_nothing/4055-apostrophe_inside_a_comment/input.rs --strip-str-comments
cloc --json --config /tmp/linejudge-empty-file cases/4000-a_quote_that_opens_nothing/4055-apostrophe_inside_a_comment/input.rs --docstring-as-code
codestats cases/4000-a_quote_that_opens_nothing/4055-apostrophe_inside_a_comment/input.rs --output json-compact --include-generated --no-gitignore --hidden --no-config
mezura cases/4000-a_quote_that_opens_nothing/4055-apostrophe_inside_a_comment/input.rs --output json --hide timing --no-default-config --no-local --counting content
mezura cases/4000-a_quote_that_opens_nothing/4055-apostrophe_inside_a_comment/input.rs --output json --hide timing --no-default-config --no-local --counting region
the double quote inside the character literal '"' opens a string that runs to the end of the file, so the three comment lines at the bottom count as code. With both apostrophes taken out the answer is the same
scc --format json --no-config cases/4000-a_quote_that_opens_nothing/4055-apostrophe_inside_a_comment/input.rs
the double quote inside the character literal '"' opens a string that runs to the end of the file, so the three comment lines at the bottom count as code. With both apostrophes taken out the answer is the same
tokei --output json cases/4000-a_quote_that_opens_nothing/4055-apostrophe_inside_a_comment/input.rs