Skip to content

Commit

Permalink
for each array thing
Browse files Browse the repository at this point in the history
  • Loading branch information
jwklong authored Jan 11, 2025
1 parent edd5c14 commit c14ac43
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/extensions/jwArray/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ class Extension {
opcode: 'get',
text: 'get [INDEX] in [ARRAY]',
blockType: BlockType.REPORTER,
allowDropAnywhere: true,
arguments: {
ARRAY: jwArray.Argument,
INDEX: {
Expand Down Expand Up @@ -250,6 +251,41 @@ class Extension {
}
},
...jwArray.Block
},
"---",
{
opcode: 'forEachI',
text: 'index'
blockType: BlockType.REPORTER,
hideFromPalette: true,
allowDropAnywhere: true
},
{
opcode: 'forEachV',
text: 'value'
blockType: BlockType.REPORTER,
hideFromPalette: true,
allowDropAnywhere: true
},
{
opcode: 'forEach',
text: 'for [I] [V] of [ARRAY]',
blockType: BlockType.COMMAND,
hideFromPalette: true,
arguments: {
ARRAY: jwArray.Argument,
I: {},
V: {}
}
},
{
blockType: BlockType.XML,
xml: `
<block type="jwArray_forEach">
<value name="I"><shadow type="jwArray_forEachI"></shadow></value>
<value name="V"><shadow type="jwArray_forEachV"></shadow></value>
</block>
`
}
],
menus: {
Expand Down

0 comments on commit c14ac43

Please sign in to comment.