← every case · 2000 · string forms

2060-backtick_template_holding_a_comment

a line comment symbol inside a template literal is text

read ascloc.defaultmezura.contentmezura.regionscc.defaulttokei.default
input.js
1codelet t = `a template
2code// not a comment, it is inside the template
3codestill the template`;
4codelet x = 1;

stringcommentthe tag around another language

What each tool answered

cloc.default ✗ fails

a // at the head of a line opens a comment inside a backtick template as readily as outside one, so that line of template text counts as a comment

the rules ask4 lines · 0 blanks · 4 code · 0 comments
it answers4 lines · 0 blanks · 3 code · 1 comments

cloc --json cases/2000-string_forms/2060-backtick_template_holding_a_comment/input.js

mezura.content ✓ agrees
the rules ask4 lines · 4 code · 0 comments · 0 extra
it answers4 lines · 4 code · 0 comments · 0 extra

mezura cases/2000-string_forms/2060-backtick_template_holding_a_comment/input.js --output json --hide timing --counting content

mezura.region ✓ agrees
the rules ask4 lines · 0 blanks · 4 code · 0 comments
it answers4 lines · 0 blanks · 4 code · 0 comments

mezura cases/2000-string_forms/2060-backtick_template_holding_a_comment/input.js --output json --hide timing --counting region

scc.default ✓ agrees
the rules ask4 lines · 0 blanks · 4 code · 0 comments
it answers4 lines · 0 blanks · 4 code · 0 comments

scc --format json cases/2000-string_forms/2060-backtick_template_holding_a_comment/input.js

tokei.default ✓ agrees
the rules ask4 lines · 0 blanks · 4 code · 0 comments
it answers4 lines · 0 blanks · 4 code · 0 comments

tokei --output json cases/2000-string_forms/2060-backtick_template_holding_a_comment/input.js