← every case · 2000 · string forms

2180-lua_short_closer_hiding_the_real_one

a Lua comment opened with one equals sign, ended by a line reading ]]=]. The bare ]] at the front of that line matches nothing, and the real closer ]=] begins one character inside it, so a counter searching left to right finds the wrong one first

read ascloc.defaultmezura.contentmezura.regionscc.defaulttokei.default
input.lua
1comments--[=[ a level one comment
2comments]]=]
3codex = 1

stringcommentthe tag around another language

What each tool answered

cloc.default ✓ agrees
the rules ask3 lines · 0 blanks · 1 code · 2 comments
it answers3 lines · 0 blanks · 1 code · 2 comments

cloc --json cases/2000-string_forms/2180-lua_short_closer_hiding_the_real_one/input.lua

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

mezura cases/2000-string_forms/2180-lua_short_closer_hiding_the_real_one/input.lua --output json --hide timing --counting content

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

mezura cases/2000-string_forms/2180-lua_short_closer_hiding_the_real_one/input.lua --output json --hide timing --counting region

scc.default ✓ agrees
the rules ask3 lines · 0 blanks · 1 code · 2 comments
it answers3 lines · 0 blanks · 1 code · 2 comments

scc --format json cases/2000-string_forms/2180-lua_short_closer_hiding_the_real_one/input.lua

tokei.default ✗ fails

its Lua carries only --[[ , so --[=[ reads as an ordinary -- line comment and the two lines under it count as code, whatever the closer is written like

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

tokei --output json cases/2000-string_forms/2180-lua_short_closer_hiding_the_real_one/input.lua