Files
my-website-base/src/highlight/keywords.lua
2025-11-26 17:24:20 +02:00

17 lines
295 B
Lua

--- @param list string[]
return function (list)
table.sort(list, function (a, b)
return #a > #b;
end);
--- @param src string
--- @param i integer
return function (src, i)
for j = 1, #list do
if src:sub(i, i + #list[j] - 1) == list[j] then
return list[j];
end
end
end;
end