UVL: Fixed dependency handling
This commit is contained in:
parent
c6492df613
commit
e5cb252043
1 changed files with 4 additions and 4 deletions
|
@ -663,20 +663,20 @@ end
|
||||||
|
|
||||||
-- Read a dependency specification
|
-- Read a dependency specification
|
||||||
function UVL._read_dependency( self, values, deps )
|
function UVL._read_dependency( self, values, deps )
|
||||||
local expr = "%$?[a-zA-Z0-9_]+"
|
local expr = "%$?[%w_]+"
|
||||||
if values then
|
if values then
|
||||||
values = ( type(values) == "table" and values or { values } )
|
values = ( type(values) == "table" and values or { values } )
|
||||||
for _, value in ipairs(values) do
|
for _, value in ipairs(values) do
|
||||||
local condition = { }
|
local condition = { }
|
||||||
for val in value:gmatch("[^%s,]+") do
|
for val in value:gmatch("[^,]+") do
|
||||||
local k, v = val:match("([^%s=]+)%s*=*%s*([^%s]*)")
|
local k, e, v = val:match("%s*([%w$_.]+)%s*(=?)%s*(.*)")
|
||||||
|
|
||||||
if k and (
|
if k and (
|
||||||
k:match("^"..expr.."%."..expr.."%."..expr.."$") or
|
k:match("^"..expr.."%."..expr.."%."..expr.."$") or
|
||||||
k:match("^"..expr.."%."..expr.."$") or
|
k:match("^"..expr.."%."..expr.."$") or
|
||||||
k:match("^"..expr.."$")
|
k:match("^"..expr.."$")
|
||||||
) then
|
) then
|
||||||
condition[k] = v or true
|
condition[k] = (e == '=') and v or true
|
||||||
else
|
else
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue