File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -859,6 +859,28 @@ Blockly.Python['hashmap_get_value'] = function(block) {
859859 return [ code , Blockly . Python . ORDER_NONE ] ;
860860} ;
861861
862+ Blockly . Blocks [ 'hashmap_get_keys' ] = {
863+ init : function ( ) {
864+ this . appendDummyInput ( )
865+ . appendField ( "get keys" ) ;
866+ this . appendValueInput ( "map" )
867+ . setCheck ( "HashMap" )
868+ . appendField ( "from " ) ;
869+ this . setInputsInline ( true ) ;
870+ this . setOutput ( true , "Array" ) ;
871+ this . setColour ( 230 ) ;
872+ this . setTooltip ( "get keys from an hashmap" ) ;
873+ this . setHelpUrl ( "" ) ;
874+ }
875+ } ;
876+
877+ Blockly . Python [ 'hashmap_get_keys' ] = function ( block ) {
878+ var value_map = Blockly . Python . valueToCode ( block , 'map' , Blockly . Python . ORDER_ATOMIC ) ;
879+ var code = value_map + '.keys()' ;
880+ return [ code , Blockly . Python . ORDER_NONE ] ;
881+ } ;
882+
883+
862884Blockly . Blocks [ 'coderbot_conv_get_action' ] = {
863885 init : function ( ) {
864886 this . appendDummyInput ( )
Original file line number Diff line number Diff line change 162162 </block >
163163 <block type =" hashmap_get_value" >
164164 </block >
165+ <block type =" hashmap_get_keys" >
166+ </block >
165167 </category >
166168 <category name =" {% trans %}Variables{% endtrans %}" custom =" VARIABLE" colour =" 330" ></category >
167169 <category name =" {% trans %}Functions{% endtrans %}" custom =" PROCEDURE" colour =" 290" ></category >
You can’t perform that action at this time.
0 commit comments