← every case · 2000 · string forms

2030-string_symbol_of_another_kind_inside

only the symbol that opened a string can close it, so the other kind inside is text. A counter that lets the other kind close it is left with a string open at the end of the line, so if its strings run across lines it counts the comment at the end as code

read ascloc.defaultcloc.docstring-as-codecodestats.defaultmezura.contentmezura.regionscc.defaulttokei.default
input.py
1codea = "an apostrophe ' inside a double quoted string"
2codeb = 'a quote " inside a single quoted string'
3comments# a real comment

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/2000-string_forms/2030-string_symbol_of_another_kind_inside/input.py

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/2030-string_symbol_of_another_kind_inside/input.py --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/2000-string_forms/2030-string_symbol_of_another_kind_inside/input.py --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/2030-string_symbol_of_another_kind_inside/input.py --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/2030-string_symbol_of_another_kind_inside/input.py --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/2030-string_symbol_of_another_kind_inside/input.py --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/2030-string_symbol_of_another_kind_inside/input.py

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/2030-string_symbol_of_another_kind_inside/input.py