← every case · 1000 · comments

1040-pairs_in_either_order

four pairs of lines, each holding the same two things in opposite order: code and a comment, a string and a comment, a brace and a comment, a semicolon and a wordless comment. Swapping the two changes neither of them, so the two lines of a pair have to be counted the same way whichever one a counter meets first. The string pair is the one that shows words inside a comment do not outweigh a string on the same line, in either direction

read ascloc.defaultmezura.contentmezura.regionscc.defaulttokei.default
input.c
1codeint a = 1; /* note */
2code/* note */ int b = 2;
3code"s" /* words */
4code/* words */ "s"
5code} /* words */
6code/* words */ }
7code; /* ---- */
8code/* ---- */ ;

stringcommentthe tag around another language

What each tool answered

cloc.default ✓ agrees
the rules ask8 lines · 0 blanks · 8 code · 0 comments
it answers8 lines · 0 blanks · 8 code · 0 comments

cloc --json cases/1000-comments/1040-pairs_in_either_order/input.c

mezura.content ✓ agrees
the rules ask8 lines · 4 code · 2 comments · 2 extra
it answers8 lines · 4 code · 2 comments · 2 extra

mezura cases/1000-comments/1040-pairs_in_either_order/input.c --output json --hide timing --counting content

mezura.region ✓ agrees
the rules ask8 lines · 0 blanks · 8 code · 0 comments
it answers8 lines · 0 blanks · 8 code · 0 comments

mezura cases/1000-comments/1040-pairs_in_either_order/input.c --output json --hide timing --counting region

scc.default ✓ agrees
the rules ask8 lines · 0 blanks · 8 code · 0 comments
it answers8 lines · 0 blanks · 8 code · 0 comments

scc --format json cases/1000-comments/1040-pairs_in_either_order/input.c

tokei.default ✓ agrees
the rules ask8 lines · 0 blanks · 8 code · 0 comments
it answers8 lines · 0 blanks · 8 code · 0 comments

tokei --output json cases/1000-comments/1040-pairs_in_either_order/input.c