← every case · 1000 · comments
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
| 1 | commentscommentscommentscommentscomments | #[==[ a bracket comment |
| 2 | commentscommentscommentscommentscomments | ]] not the end |
| 3 | commentsextracommentscommentscomments | ]==] |
| 4 | codecodecodecodecode | set(X 1) |
stringcommentthe tag around another language
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
cloc --json cases/1000-comments/1180-cmake_bracket_comment/input.cmake
mezura cases/1000-comments/1180-cmake_bracket_comment/input.cmake --output json --hide timing --counting content
mezura cases/1000-comments/1180-cmake_bracket_comment/input.cmake --output json --hide timing --counting region
the bracket comment is not recognised at all, so the whole file counts as code
scc --format json cases/1000-comments/1180-cmake_bracket_comment/input.cmake
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
tokei --output json cases/1000-comments/1180-cmake_bracket_comment/input.cmake