← every case · 3000 · escapes and the closing quote

3080-backtick_escapes_inside_a_double_quoted_string

the backtick is what escapes inside PowerShell's double quoted string, so the quote in the middle of the line closes nothing. A block comment opens after the string, so a counter that ends the string at that quote opens another at the last one and hides the comment, whether its strings end with the line or run on

read ascloc.defaultcloc.docstring-as-codecodestats.defaultmezura.contentmezura.regionscc.defaulttokei.default
input.ps1
1codeWrite-Host "a `" b" <# a real comment
2commentsthat closes on this line #>
3code$x = 1

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/3080-backtick_escapes_inside_a_double_quoted_string/input.ps1

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/3080-backtick_escapes_inside_a_double_quoted_string/input.ps1 --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/3080-backtick_escapes_inside_a_double_quoted_string/input.ps1 --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/3080-backtick_escapes_inside_a_double_quoted_string/input.ps1 --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/3080-backtick_escapes_inside_a_double_quoted_string/input.ps1 --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/3080-backtick_escapes_inside_a_double_quoted_string/input.ps1 --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/3080-backtick_escapes_inside_a_double_quoted_string/input.ps1

tokei.default ✗ fails

the backtick is no escape to it, so the last quote opens a string that crosses lines

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/3080-backtick_escapes_inside_a_double_quoted_string/input.ps1