0.52: Small fixes for closer conformance with regular Lua.
This commit is contained in:
@@ -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(", ")"))
|
||||
|
||||
Reference in New Issue
Block a user