← every case · 2000 · string forms
the hole of a JavaScript template literal, from ${ to the } that closes it, is code, and here it runs over three lines. The comment line inside the hole is a real comment. A counter that reads the template as text from one backtick to the next counts that line as part of the string
| 1 | codecodecodecodecodecodecode | const s = `a ${ |
| 2 | commentscommentscommentscommentscommentscommentscomments | // a comment inside the hole |
| 3 | codecodecodecodecodecodecode | f(x) |
| 4 | codecodecodecodecodecodecode | } b`; /* a real comment |
| 5 | commentscommentscommentscommentscommentscommentscomments | that closes on this line */ |
| 6 | codecodecodecodecodecodecode | let y = 1; |
stringcommentthe tag around another language
cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2062-template_hole_written_over_several_lines/input.js
--strip-str-comments
cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2062-template_hole_written_over_several_lines/input.js --strip-str-comments
cloc --json --config /tmp/linejudge-empty-file cases/2000-string_forms/2062-template_hole_written_over_several_lines/input.js --docstring-as-code
codestats cases/2000-string_forms/2062-template_hole_written_over_several_lines/input.js --output json-compact --include-generated --no-gitignore --hidden --no-config
mezura cases/2000-string_forms/2062-template_hole_written_over_several_lines/input.js --output json --hide timing --no-default-config --no-local --counting content
mezura cases/2000-string_forms/2062-template_hole_written_over_several_lines/input.js --output json --hide timing --no-default-config --no-local --counting region
the template is read as text from one backtick to the next, hole included, so the comment line inside the hole counts as code. With that line taken out the file is counted right
scc --format json --no-config cases/2000-string_forms/2062-template_hole_written_over_several_lines/input.js
the template is read as text from one backtick to the next, hole included, so the comment line inside the hole counts as code. With that line taken out the file is counted right
tokei --output json cases/2000-string_forms/2062-template_hole_written_over_several_lines/input.js