← every case · 7000 · literals with their own delimiters

7010-regex_literal_holding_a_quote

a double quote inside a JavaScript regular expression, where it is part of the pattern and opens no string. A counter fooled by it is left inside a string that nothing closes, and every line under it goes the same way

read ascloc.defaultmezura.contentmezura.regionscc.defaulttokei.default
input.js
1codelet re = /"/;
2codelet x = 1;
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 cases/7000-literals_with_their_own_delimiters/7010-regex_literal_holding_a_quote/input.js

mezura.content ✓ agrees
the rules ask3 lines · 2 code · 1 comments · 0 extra
it answers3 lines · 2 code · 1 comments · 0 extra

mezura cases/7000-literals_with_their_own_delimiters/7010-regex_literal_holding_a_quote/input.js --output json --hide timing --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/7000-literals_with_their_own_delimiters/7010-regex_literal_holding_a_quote/input.js --output json --hide timing --counting region

scc.default ✗ fails

the quote opens a string that runs on, so the comment under it is counted as code

the rules ask3 lines · 0 blanks · 2 code · 1 comments
it answers3 lines · 0 blanks · 3 code · 0 comments

scc --format json cases/7000-literals_with_their_own_delimiters/7010-regex_literal_holding_a_quote/input.js

tokei.default ✗ fails

the quote opens a string that runs on, so the comment under it is counted as code

the rules ask3 lines · 0 blanks · 2 code · 1 comments
it answers3 lines · 0 blanks · 3 code · 0 comments

tokei --output json cases/7000-literals_with_their_own_delimiters/7010-regex_literal_holding_a_quote/input.js