← 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. A block comment opens after the string on the same line, so a counter that reads the backslash as an escape leaves the string open and hides the opener, whether its strings end with the line or run on

read ascloc.defaultcloc.docstring-as-codecodestats.defaultmezura.contentmezura.regionscc.defaulttokei.default
input.sql
1codeUPDATE t SET path = 'C:\'; /* a real comment
2commentsthat closes on this line */
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 --config /tmp/linejudge-empty-file cases/3000-escapes_and_the_closing_quote/3070-backslash_before_a_closing_quote_in_sql/input.sql

cloc.default ✓ agrees

--strip-str-comments

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

cloc --json --config /tmp/linejudge-empty-file cases/3000-escapes_and_the_closing_quote/3070-backslash_before_a_closing_quote_in_sql/input.sql --strip-str-comments

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

cloc --json --config /tmp/linejudge-empty-file cases/3000-escapes_and_the_closing_quote/3070-backslash_before_a_closing_quote_in_sql/input.sql --docstring-as-code

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

codestats cases/3000-escapes_and_the_closing_quote/3070-backslash_before_a_closing_quote_in_sql/input.sql --output json-compact --include-generated --no-gitignore --hidden --no-config

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 --no-default-config --no-local --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 --no-default-config --no-local --counting region

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

scc --format json --no-config 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 after 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