← every case · 2000 · string forms

2085-raw_string_ending_in_a_quote

a Kotlin raw string ends at the last three quotes of a run, so a quote written just before its closer is text, and the string here ends with four quotes in a row. A counter that closes it at the first three is left with one quote over, which opens a string that runs into the comment after it and hides where that comment begins. The text holds an address and an inch mark on purpose: a counter that reads no strings takes the // of the address for a line comment, and one that pairs the quotes with no raw form ends with the comment opener inside a string of its own making, so neither finds the comment by accident

read ascloc.defaultcloc.docstring-as-codecodestats.defaultmezura.contentmezura.regionscc.defaulttokei.default
input.kt
1codeval note = """see https://example.com/ for 12" of "snow"""" /* the "note",
2commentswritten the way the client sends it */
3codeval x = 1

stringcommentthe tag around another language

What each tool answered

cloc.default ✗ fails

the // of the address inside the raw string is taken for a line comment that cuts the first line, so the /* after it is never seen and the comment's second line counts as code

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

cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2085-raw_string_ending_in_a_quote/input.kt

cloc.default ✗ fails

--strip-str-comments

the /* on the first line is blanked as text inside a string, so the comment's second line counts as code

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

cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2085-raw_string_ending_in_a_quote/input.kt --strip-str-comments

cloc.docstring-as-code ✗ fails

the // of the address inside the raw string is taken for a line comment that cuts the first line, so the /* after it is never seen and the comment's second line counts as code

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

cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2085-raw_string_ending_in_a_quote/input.kt --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/2085-raw_string_ending_in_a_quote/input.kt --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/2085-raw_string_ending_in_a_quote/input.kt --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/2085-raw_string_ending_in_a_quote/input.kt --output json --hide timing --no-default-config --no-local --counting region

scc.default ✗ fails

its Kotlin has no raw string, so the quotes of the first line pair off two by two, the /* falls inside one of the pairs, and the quote left over opens a string that runs to the end of the file

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

scc --format json --no-config cases/2000-string_forms/2085-raw_string_ending_in_a_quote/input.kt

tokei.default ✗ fails

the raw string closes at the first three of the four quotes, and the quote left over opens a string that takes the comment opener with it, so the comment's second line counts as code

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

tokei --output json cases/2000-string_forms/2085-raw_string_ending_in_a_quote/input.kt