WIP: sprintf #21

Draft
kistaro wants to merge 11 commits from kistaro/chameleonic:sprintf into main
Showing only changes of commit 3516d2855e - Show all commits

View File

@ -44,8 +44,13 @@ end
-- %! for tostring(param)
-- which dumps tables
function fmt(f, ...)
local out, i = "", 1
local out, i = "", 0
for s in all(split(f,"%")) do
if i == 0 then
-- before first format directive
out ..= s
i = 1
else
local m = s[1]
if m == "~" then
out ..= "%"
@ -62,6 +67,7 @@ function fmt(f, ...)
end
out ..=sub(s,2)
end
end
return out
end