mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-22 07:13:45 +01:00
Fix patterns
This commit is contained in:
parent
cc88228d25
commit
e49d75a822
@ -185,7 +185,7 @@ function colorspec.from_string(string)
|
|||||||
if number then
|
if number then
|
||||||
return colorspec.from_number(number * 0x100 + alpha)
|
return colorspec.from_number(number * 0x100 + alpha)
|
||||||
end
|
end
|
||||||
local hex_text = string:match(hex)
|
local hex_text = string:match("^" .. hex .. "$")
|
||||||
local len, num = hex_text:len(), tonumber(hex_text, 16)
|
local len, num = hex_text:len(), tonumber(hex_text, 16)
|
||||||
if len == 8 then
|
if len == 8 then
|
||||||
return colorspec.from_number(num)
|
return colorspec.from_number(num)
|
||||||
|
@ -112,7 +112,7 @@ function lua_log_file:_dump(value, is_key)
|
|||||||
end
|
end
|
||||||
if _type == "string" then
|
if _type == "string" then
|
||||||
local reference_strings = self.reference_strings
|
local reference_strings = self.reference_strings
|
||||||
if is_key and ((not reference_strings) or value:len() <= key:len()) and value:match"[%a_][%a%d_]*" then
|
if is_key and ((not reference_strings) or value:len() <= key:len()) and value:match"^[%a_][%a%d_]*$" then
|
||||||
-- Short key
|
-- Short key
|
||||||
return value, true
|
return value, true
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user