← every case · 3000 · escapes and the closing quote

3070-backslash_before_a_closing_quote_in_sql

standard SQL escapes a quote by doubling it and the backslash is an ordinary character

read ascloc.defaultmezura.contentmezura.regionscc.defaulttokei.default
input.sql
1codeUPDATE t SET path = 'C:\';
2comments-- a real comment
3codeSELECT 2;

stringcommentthe tag around another language

What each tool answered

cloc.default ✓ agrees
the rules ask3 lines · 0 blanks · 2 code · 1 comments
it answers3 lines · 0 blanks · 2 code · 1 comments

cloc --json cases/3000-escapes_and_the_closing_quote/3070-backslash_before_a_closing_quote_in_sql/input.sql

mezura.content ✓ agrees
the rules ask3 lines · 2 code · 1 comments · 0 extra
it answers3 lines · 2 code · 1 comments · 0 extra

mezura cases/3000-escapes_and_the_closing_quote/3070-backslash_before_a_closing_quote_in_sql/input.sql --output json --hide timing --counting content

mezura.region ✓ agrees
the rules ask3 lines · 0 blanks · 2 code · 1 comments
it answers3 lines · 0 blanks · 2 code · 1 comments

mezura cases/3000-escapes_and_the_closing_quote/3070-backslash_before_a_closing_quote_in_sql/input.sql --output json --hide timing --counting region

scc.default ✗ fails

the backslash cancels the closing quote, and its strings cross lines, so the comment under the path is counted as string content

the rules ask3 lines · 0 blanks · 2 code · 1 comments
it answers3 lines · 0 blanks · 3 code · 0 comments

scc --format json cases/3000-escapes_and_the_closing_quote/3070-backslash_before_a_closing_quote_in_sql/input.sql

tokei.default ✗ fails

the backslash cancels the closing quote, and its strings cross lines, so the comment under the path is counted as string content

the rules ask3 lines · 0 blanks · 2 code · 1 comments
it answers3 lines · 0 blanks · 3 code · 0 comments

tokei --output json cases/3000-escapes_and_the_closing_quote/3070-backslash_before_a_closing_quote_in_sql/input.sql