To find the first word we currently strip all Lua comments. This is really wasteful for large definitions. At least avoid all these allocations if the first word is not a comment.
SM7UNXQMKBTBJBR7LWL5LV2SSWQ4OGWCUNHYPAZ2DUH5UXIZXBDQC
return buf:gsub('%-%-[^\n]*', ''):match('^%s*(%S+)')
-- Return the first word, after skipping Lua comments.
if not buf:match('^%s*%-%-') then
return buf:match('^%s*(%S+)') -- avoid unnecessary allocations
end
-- wastefully strip out comments everywhere, not just at the start
buf = buf:gsub('%-%-[^\n]*', '') -- line comments
return buf:match('^%s*(%S+)')