0.52: Small fixes for closer conformance with regular Lua.

This commit is contained in:
Ian Farmer
2008-09-04 17:24:57 +00:00
parent 0808aa3791
commit a0b1aef0b1
4 changed files with 22 additions and 7 deletions

View File

@@ -151,4 +151,18 @@ for i,letter in ipairs(letters) do
end
end
end
--]]
--]]
local function fmterr(...)
local r, s = pcall(...)
if r then
return s
else
s = string.gsub(s, "stdin:%d+:%s*", "")
return s
end
end
print(fmterr(string.find, "ab%c)0(", "%"))
print(fmterr(string.find, "ab%c)0(", "("))
print(pcall(string.find, "ab%c)0(", ")"))