Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Zenroom
Zenroom
Commits
945b2111
Commit
945b2111
authored
May 12, 2022
by
Jaromil
Browse files
zencode array insert true or false in array/dict
parent
e9424f29
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lua/zencode_array.lua
View file @
945b2111
...
...
@@ -123,6 +123,23 @@ When("insert string '' in ''", function(st, dest)
table.insert
(
ACK
[
dest
],
O
.
from_string
(
st
))
end
)
When
(
"insert true '' in ''"
,
function
(
st
,
dest
)
local
d
=
have
(
dest
)
ZEN
.
assert
(
luatype
(
d
)
==
'table'
,
"Invalid destination, not a table: "
..
dest
)
ZEN
.
assert
(
ZEN
.
CODEC
[
dest
].
zentype
==
'array'
,
"Invalid destination, not an array: "
..
dest
)
table.insert
(
ACK
[
dest
],
true
)
end
)
When
(
"insert false '' in ''"
,
function
(
st
,
dest
)
local
d
=
have
(
dest
)
ZEN
.
assert
(
luatype
(
d
)
==
'table'
,
"Invalid destination, not a table: "
..
dest
)
ZEN
.
assert
(
ZEN
.
CODEC
[
dest
].
zentype
==
'array'
,
"Invalid destination, not an array: "
..
dest
)
table.insert
(
ACK
[
dest
],
false
)
end
)
When
(
"insert '' in ''"
,
function
(
ele
,
dest
)
local
d
=
have
(
dest
)
local
e
=
have
(
ele
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment