← every case · 2000 · string forms

2079-doubled_brace_in_an_interpolated_string

in a C# interpolated string a brace written twice, {{, is one brace of text and opens no hole. A counter that opens a hole there reads the /* inside the string as the start of a block comment, and the code line below comes out as a comment

read ascloc.defaultcloc.docstring-as-codecodestats.defaultmezura.contentmezura.regionscc.defaulttokei.default
input.cs
1codevar s = $"{{ /* braces";
2codeint z = 1;
3comments/* a real comment */

stringcommentthe tag around another language

What each tool answered

cloc.default ✗ fails

the /* inside the string opens a block comment, so the code line below counts as a comment. A plain string "{ /* braces" with no $ and one brace does the same, and --strip-str-comments counts both right

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

cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2079-doubled_brace_in_an_interpolated_string/input.cs

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/2000-string_forms/2079-doubled_brace_in_an_interpolated_string/input.cs --strip-str-comments

cloc.docstring-as-code ✗ fails

the /* inside the string opens a block comment, so the code line below counts as a comment. A plain string "{ /* braces" with no $ and one brace does the same, and --strip-str-comments counts both right

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

cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2079-doubled_brace_in_an_interpolated_string/input.cs --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/2000-string_forms/2079-doubled_brace_in_an_interpolated_string/input.cs --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/2000-string_forms/2079-doubled_brace_in_an_interpolated_string/input.cs --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/2000-string_forms/2079-doubled_brace_in_an_interpolated_string/input.cs --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/2000-string_forms/2079-doubled_brace_in_an_interpolated_string/input.cs

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

tokei --output json cases/2000-string_forms/2079-doubled_brace_in_an_interpolated_string/input.cs