← every case · 4000 · a quote that opens nothing

4020-two_char_literals_holding_escapes

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, and not a line contrived for this suite

read ascloc.defaultmezura.contentmezura.regionscc.defaulttokei.default
input.rs
1codefn js_escape(s: &str) -> String {
2code s.replace('\\', "\\\\").replace('"', "\\\"")
3code}
4comments// one
5comments// two
6comments// three

stringcommentthe tag around another language

What each tool answered

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

cloc --json cases/4000-a_quote_that_opens_nothing/4020-two_char_literals_holding_escapes/input.rs

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

mezura cases/4000-a_quote_that_opens_nothing/4020-two_char_literals_holding_escapes/input.rs --output json --hide timing --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/4000-a_quote_that_opens_nothing/4020-two_char_literals_holding_escapes/input.rs --output json --hide timing --counting region

scc.default ✗ fails

every comment under the line is lost

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

scc --format json cases/4000-a_quote_that_opens_nothing/4020-two_char_literals_holding_escapes/input.rs

tokei.default ✗ fails

every comment under the line is lost

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

tokei --output json cases/4000-a_quote_that_opens_nothing/4020-two_char_literals_holding_escapes/input.rs