diff --git a/init.lua b/init.lua index 3617a7f..aaa175a 100644 --- a/init.lua +++ b/init.lua @@ -61,4 +61,17 @@ function M.diff_surface(surface, readme) return { missing_docs = missing, stale_docs = stale } end +-- Extracts unique engine.. calls from Lua source. +-- Returns: array of unique strings, sorted. +function M.grep_engine_calls(source_string) + local seen = {} + for call in string.gmatch(source_string, "(engine%.[_%w]+%.[_%w]+)") do + seen[call] = true + end + local out = {} + for call in pairs(seen) do table.insert(out, call) end + table.sort(out) + return out +end + return M