← every case · 2000 · string forms

2078-raw_interpolated_string_opened_by_a_dollar_and_three_quotes

a C# raw interpolated string opens with $ and three quotes. Two openers begin inside those four bytes, the $" of an ordinary interpolated string and the """ of a raw string, and it is the raw string that opens. A counter that takes $" ends the string with its line, so the line inside the string that looks like a comment counts as one, and the closing """ then opens a raw string that hides the real comment below it

read ascloc.defaultcloc.docstring-as-codecodestats.defaultmezura.contentmezura.regionscc.defaulttokei.default
input.cs
1codevar s = $"""
2code // still inside the string
3code {x}
4code """;
5comments// a real comment
6codeint y = 1;

stringcommentthe tag around another language

What each tool answered

cloc.default ✗ fails

the // line inside the string counts as a comment, and it does the same inside a verbatim string @" written over the same lines

the rules ask6 lines · 0 blanks · 5 code · 1 comments
it answers6 lines · 0 blanks · 4 code · 2 comments

cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2078-raw_interpolated_string_opened_by_a_dollar_and_three_quotes/input.cs

cloc.default ✗ fails

--strip-str-comments

the // line inside the string counts as a comment, and it does the same inside a verbatim string @" written over the same lines

the rules ask6 lines · 0 blanks · 5 code · 1 comments
it answers6 lines · 0 blanks · 4 code · 2 comments

cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2078-raw_interpolated_string_opened_by_a_dollar_and_three_quotes/input.cs --strip-str-comments

cloc.docstring-as-code ✗ fails

the // line inside the string counts as a comment, and it does the same inside a verbatim string @" written over the same lines

the rules ask6 lines · 0 blanks · 5 code · 1 comments
it answers6 lines · 0 blanks · 4 code · 2 comments

cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2078-raw_interpolated_string_opened_by_a_dollar_and_three_quotes/input.cs --docstring-as-code

codestats.default ✓ agrees
the rules ask6 lines · 0 blanks · 5 code · 1 comments
it answers6 lines · 0 blanks · 5 code · 1 comments

codestats cases/2000-string_forms/2078-raw_interpolated_string_opened_by_a_dollar_and_three_quotes/input.cs --output json-compact --include-generated --no-gitignore --hidden --no-config

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

mezura cases/2000-string_forms/2078-raw_interpolated_string_opened_by_a_dollar_and_three_quotes/input.cs --output json --hide timing --no-default-config --no-local --counting content

mezura.region ✓ agrees
the rules ask6 lines · 0 blanks · 5 code · 1 comments
it answers6 lines · 0 blanks · 5 code · 1 comments

mezura cases/2000-string_forms/2078-raw_interpolated_string_opened_by_a_dollar_and_three_quotes/input.cs --output json --hide timing --no-default-config --no-local --counting region

scc.default ✓ agrees
the rules ask6 lines · 0 blanks · 5 code · 1 comments
it answers6 lines · 0 blanks · 5 code · 1 comments

scc --format json --no-config cases/2000-string_forms/2078-raw_interpolated_string_opened_by_a_dollar_and_three_quotes/input.cs

tokei.default ✓ agrees
the rules ask6 lines · 0 blanks · 5 code · 1 comments
it answers6 lines · 0 blanks · 5 code · 1 comments

tokei --output json cases/2000-string_forms/2078-raw_interpolated_string_opened_by_a_dollar_and_three_quotes/input.cs