#1918·eza

bug: lua loc counting broken for block comments

Author: tranzystorekkCreated Aug 18, 2026Updated Aug 22, 2026
Labelstype: bug

eza --version: 0.23.5

i was inspecting eza's loc counting impl, when i noticed Lua's block comments are not detected properly, e.g.

lua
local x = 1 --[[
local y
local z
]]

outputs:

Image

instead of 1 code, 3 comments

the culprit seems to be that loc detects line comments first, together with the unfortunate fact that Lua's line comment sequence is a direct prefix to the block comment start sequence (-- -> --[[)

this bug is so language specific that i didn't want to pr a fix without some discussion first (e.g. naively reordering loc code to parse for block comments before line comments)