← every case · 2000 · string forms
a C++ raw string that puts a word of its own between the R" and the bracket, and then ends only at that same word. The closer is chosen where the string is written, so no fixed list of symbols can say what ends this one. Its first line holds )", the closer of the plain form, so a counter that ends every raw string at the first )" closes this one there and reads the block opener on the next line as a comment. A lone quote earlier on that line keeps the count of quotes even, so a counter that only pairs quotes reaches the block opener with nothing open as well. The file ends with a block comment of its own, so the comment opened by mistake has a closer to reach, and a counter that ignores an opener nobody closes cannot pass by accident
| 1 | codecodecodecodecodecodecode | const char *raw = R"xy(a lone " then ")" in it |
| 2 | codecodecodecodecodecodecode | /* this opens nothing, it is inside the raw string |
| 3 | codecodecodecodecodecodecode | )xy"; |
| 4 | codecodecodecodecodecodecode | printf("done"); |
| 5 | commentscommentscommentscommentscommentscommentscomments | /* a real comment */ |
stringcommentthe tag around another language
the /* on the second line opens a comment, which the block comment ending the file closes. A /* inside an ordinary string on one line opens one as well, so no string keeps it out
cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2150-delimited_raw_string_names_its_own_closer/input.cpp
--strip-str-comments
the /* on the second line opens a comment, which the block comment ending the file closes. A /* inside an ordinary string on one line opens one as well, so no string keeps it out
cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2150-delimited_raw_string_names_its_own_closer/input.cpp --strip-str-comments
the /* on the second line opens a comment, which the block comment ending the file closes. A /* inside an ordinary string on one line opens one as well, so no string keeps it out
cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2150-delimited_raw_string_names_its_own_closer/input.cpp --docstring-as-code
codestats cases/2000-string_forms/2150-delimited_raw_string_names_its_own_closer/input.cpp --output json-compact --include-generated --no-gitignore --hidden --no-config
mezura cases/2000-string_forms/2150-delimited_raw_string_names_its_own_closer/input.cpp --output json --hide timing --no-default-config --no-local --counting content
mezura cases/2000-string_forms/2150-delimited_raw_string_names_its_own_closer/input.cpp --output json --hide timing --no-default-config --no-local --counting region
scc --format json --no-config cases/2000-string_forms/2150-delimited_raw_string_names_its_own_closer/input.cpp
the delimited form is not recognised, so the four quotes of the opening line pair off as ordinary strings and the block opener under them opens a comment, which the block comment ending the file closes
tokei --output json cases/2000-string_forms/2150-delimited_raw_string_names_its_own_closer/input.cpp