LIVM/fraxinizator/ximplifier.lua

9 lines
373 B
Lua
Raw Permalink Normal View History

2022-04-15 18:22:30 +03:00
return {
source = function(source)
source = source:gsub("%(([^)]+)%)", " %1")
source = source:gsub("([|%^#][%w.]+%s+)([a-z]+)", "%1;%2"):gsub(":", ":;")
source = source:gsub("object", ";object"):gsub("section", ";section"):gsub("%[", ";["):gsub("%]", "];")
source = source:gsub("(\n%s+);", ";%1"):gsub(";(%s+);", ";%1"):gsub("^;", "")
return source .. ";"
end
}