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.
3ZB5A7NDGCZPSP3KKSYF7WDWQ6MXPS5KQG7SMD7FJSITL2NISQOAC
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+)')