← every case · 7000 · literals with their own delimiters

7020-regex_holding_a_comment_opener

a block comment opener inside a JavaScript regular expression. Knowing that the slash begins a pattern where a division could stand takes reading what came before it, which is more than any counter here attempts. What each of them does with the opener after that is its own. The file ends with a block comment of its own, so a comment opened there by mistake has a closer to reach, and a counter that ignores an opener nobody closes cannot pass by accident

read ascloc.defaultcloc.docstring-as-codecodestats.defaultmezura.contentmezura.regionscc.defaulttokei.default
input.js
1codelet re = /a[/*]b/;
2codelet x = 1;
3codelet y = 2;
4comments/* a real comment */

stringcommentthe tag around another language

What each tool answered

cloc.default ✗ fails

the /* inside the pattern is read as a comment opener, and the comment ending the file closes it, so the two code lines between count as comment

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

cloc --json --config /tmp/linejudge-empty-file cases/7000-literals_with_their_own_delimiters/7020-regex_holding_a_comment_opener/input.js

cloc.default ✗ fails

--strip-str-comments

the /* inside the pattern is read as a comment opener, and the comment ending the file closes it, so the two code lines between count as comment

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

cloc --json --config /tmp/linejudge-empty-file cases/7000-literals_with_their_own_delimiters/7020-regex_holding_a_comment_opener/input.js --strip-str-comments

cloc.docstring-as-code ✗ fails

the /* inside the pattern is read as a comment opener, and the comment ending the file closes it, so the two code lines between count as comment

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

cloc --json --config /tmp/linejudge-empty-file cases/7000-literals_with_their_own_delimiters/7020-regex_holding_a_comment_opener/input.js --docstring-as-code

codestats.default ✓ agrees
the rules ask4 lines · 0 blanks · 3 code · 1 comments
it answers4 lines · 0 blanks · 3 code · 1 comments

codestats cases/7000-literals_with_their_own_delimiters/7020-regex_holding_a_comment_opener/input.js --output json-compact --include-generated --no-gitignore --hidden --no-config

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

mezura cases/7000-literals_with_their_own_delimiters/7020-regex_holding_a_comment_opener/input.js --output json --hide timing --no-default-config --no-local --counting content

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

mezura cases/7000-literals_with_their_own_delimiters/7020-regex_holding_a_comment_opener/input.js --output json --hide timing --no-default-config --no-local --counting region

scc.default ✗ fails

the /* opens a comment that swallows the two lines under it, and the comment ending the file closes it

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

scc --format json --no-config cases/7000-literals_with_their_own_delimiters/7020-regex_holding_a_comment_opener/input.js

tokei.default ✗ fails

the /* opens a comment that swallows the two lines under it, and the comment ending the file closes it

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

tokei --output json cases/7000-literals_with_their_own_delimiters/7020-regex_holding_a_comment_opener/input.js