Unverified Commit 38c901e5 authored by Alberto Lerda's avatar Alberto Lerda Committed by GitHub
Browse files

fix: find in dictionary always return a list (#358)

parent 4af4654f
......@@ -550,19 +550,19 @@ end
-- return false: execute statement
local function manage_branching(x)
if x.section == 'if' then
xxx("START conditional execution: "..x.source, 2)
--xxx("START conditional execution: "..x.source, 2)
if not ZEN.branch then ZEN.branch_valid = true end
ZEN.branch = true
return false
end
if x.section == 'endif' then
xxx("END conditional execution: "..x.source, 2)
--xxx("END conditional execution: "..x.source, 2)
ZEN.branch = false
return true
end
if not ZEN.branch then return false end
if not ZEN.branch_valid then
xxx('skip execution in false conditional branch: '..x.source, 2)
--xxx('skip execution in false conditional branch: '..x.source, 2)
return true
end
return false
......
......@@ -195,19 +195,11 @@ When("find the '' for dictionaries in '' where '' = ''",function(name, arr, left
params.conditions[left] = ACK[right]
dicts_reduce(ACK[arr], params)
ZEN.assert(val, "No value found "..name.." across dictionaries in "..arr)
if #val == 1 then
ACK[name] = val[1]
new_codec(name, {
luatype = luatype(ACK[name]),
zentype = 'element'
}, arr)
else
ACK[name] = val
new_codec(name, {
luatype = 'table',
zentype = 'array'
}, arr)
end
ACK[name] = val
new_codec(name, {
luatype = 'table',
zentype = 'array'
}, arr)
end)
local function create_copy_f(root, in1, in2)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment