← every case · 2000 · string forms
a comment symbol inside a string is text. The address holds //, which opens a line comment anywhere outside a string, so a counter that takes it for one also hides the block comment opened after the string and counts the second line of that comment as code
| 1 | codecodecodecodecodecodecode | const url = "http://example.com/"; /* a real comment |
| 2 | commentscommentscommentscommentscommentscommentscomments | that closes on this line */ |
| 3 | codecodecodecodecodecodecode | let value = 1; |
stringcommentthe tag around another language
the // of the address inside the string is read as a line comment, which hides the /* after the string, so the line closing that comment counts as code
cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2010-comment_symbol_inside_string/input.js
--strip-str-comments
cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2010-comment_symbol_inside_string/input.js --strip-str-comments
the // of the address inside the string is read as a line comment, which hides the /* after the string, so the line closing that comment counts as code
cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2010-comment_symbol_inside_string/input.js --docstring-as-code
codestats cases/2000-string_forms/2010-comment_symbol_inside_string/input.js --output json-compact --include-generated --no-gitignore --hidden --no-config
mezura cases/2000-string_forms/2010-comment_symbol_inside_string/input.js --output json --hide timing --no-default-config --no-local --counting content
mezura cases/2000-string_forms/2010-comment_symbol_inside_string/input.js --output json --hide timing --no-default-config --no-local --counting region
scc --format json --no-config cases/2000-string_forms/2010-comment_symbol_inside_string/input.js
tokei --output json cases/2000-string_forms/2010-comment_symbol_inside_string/input.js