← every case · 1000 · comments

1180-cmake_bracket_comment

CMake opens a bracket comment with any number of equals signs between its brackets, and only a closer carrying the same number ends it. A shorter one further down is text

read ascloc.defaultmezura.contentmezura.regionscc.defaulttokei.default
input.cmake
1comments#[==[ a bracket comment
2comments]] not the end
3comments]==]
4codeset(X 1)

stringcommentthe tag around another language

What each tool answered

cloc.default ✗ fails

CMake has no bracket comment here, only the hash, which is a comment wherever the line's first mark is one. So the opener's line is a comment and its body and closing bracket count as code

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

cloc --json cases/1000-comments/1180-cmake_bracket_comment/input.cmake

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

mezura cases/1000-comments/1180-cmake_bracket_comment/input.cmake --output json --hide timing --counting content

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

mezura cases/1000-comments/1180-cmake_bracket_comment/input.cmake --output json --hide timing --counting region

scc.default ✗ fails

the bracket comment is not recognised at all, so the whole file counts as code

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

scc --format json cases/1000-comments/1180-cmake_bracket_comment/input.cmake

tokei.default ✗ fails

CMake has no bracket comment here, so the # opens a line comment that ends with its own line and the three lines under it count as code. A file holding no bare ]] at all counts the same way

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

tokei --output json cases/1000-comments/1180-cmake_bracket_comment/input.cmake