← every case · 4000 · a quote that opens nothing
two character literals on one line, one holding an escaped backslash and one holding a quote. Ordinary Rust that any escaping routine is written with, nothing contrived for this suite. The comment after them opens a block, so a counter that is left inside a string at the end of the line hides the opener whether its strings end with the line or run on
| 1 | codecodecodecodecodecodecode | fn js_escape(s: &str) -> String { |
| 2 | codecodecodecodecodecodecode | s.replace('\\', "\\\\").replace('"', "\\\"") /* backslashes first, |
| 3 | commentscommentscommentscommentscommentscommentscomments | then quotes */ |
| 4 | codecodecodeextracodecodecode | } |
| 5 | commentscommentscommentscommentscommentscommentscomments | // one |
| 6 | commentscommentscommentscommentscommentscommentscomments | // two |
| 7 | commentscommentscommentscommentscommentscommentscomments | // three |
stringcommentthe tag around another language
cloc --json --config /tmp/linejudge-empty-file cases/4000-a_quote_that_opens_nothing/4020-two_char_literals_holding_escapes/input.rs
--strip-str-comments
cloc --json --config /tmp/linejudge-empty-file cases/4000-a_quote_that_opens_nothing/4020-two_char_literals_holding_escapes/input.rs --strip-str-comments
cloc --json --config /tmp/linejudge-empty-file cases/4000-a_quote_that_opens_nothing/4020-two_char_literals_holding_escapes/input.rs --docstring-as-code
codestats cases/4000-a_quote_that_opens_nothing/4020-two_char_literals_holding_escapes/input.rs --output json-compact --include-generated --no-gitignore --hidden --no-config
mezura cases/4000-a_quote_that_opens_nothing/4020-two_char_literals_holding_escapes/input.rs --output json --hide timing --no-default-config --no-local --counting content
mezura cases/4000-a_quote_that_opens_nothing/4020-two_char_literals_holding_escapes/input.rs --output json --hide timing --no-default-config --no-local --counting region
the quote inside '"' opens a string that is still open when the line ends, so the comment after it and every comment under it count as code. Without that character literal the line reads right
scc --format json --no-config cases/4000-a_quote_that_opens_nothing/4020-two_char_literals_holding_escapes/input.rs
the quote inside '"' opens a string that is still open when the line ends, so the comment after it and every comment under it count as code. Without that character literal the line reads right
tokei --output json cases/4000-a_quote_that_opens_nothing/4020-two_char_literals_holding_escapes/input.rs