Respect empty initial value in 'append' and 'concat' actions

This commit is contained in:
mpeterv
2015-10-31 20:02:56 +03:00
parent 6dc13c3d26
commit 79952deb42
2 changed files with 18 additions and 0 deletions

View File

@@ -368,6 +368,7 @@ function actions.count(result, target, _, overwrite)
end
function actions.append(result, target, argument, overwrite)
result[target] = result[target] or {}
table.insert(result[target], argument)
if overwrite then
@@ -380,6 +381,8 @@ function actions.concat(result, target, arguments, overwrite)
error("'concat' action can't handle too many invocations")
end
result[target] = result[target] or {}
for _, argument in ipairs(arguments) do
table.insert(result[target], argument)
end