assert on unrecognized directive

saves four tokens and is more diagnostic.
This commit is contained in:
Kistaro Windrider 2023-01-01 14:11:11 -08:00
parent ce3fc83221
commit e028209adf
Signed by: kistaro
SSH Key Fingerprint: SHA256:TBE2ynfmJqsAf0CP6gsflA0q5X5wD5fVKWPsZ7eVUg8

View File

@ -62,7 +62,7 @@ function fmt(f, ...)
elseif m == "!" then
out ..= tostring(p)
else
out ..= "(?!:"..m..":"..tostring(p)..")"
assert(false, tostr(m).."is not a formatting directive")
end
end
out ..=sub(s,2)