LIVM/fraxinizator/ximplifier.lua
2022-04-16 01:22:30 +10:00

9 lines
No EOL
373 B
Lua

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
}