1234567891011121314151617 |
- 'use strict';
- goog.provide('Blockly.Python.sets');
- goog.require('Blockly.Python');
- Blockly.Python['set_create'] = function(block) {
- // Create a list with any number of elements of any type.
- var elements = new Array(block.itemCount_);
- console.log(block.itemCount_)
- for (var i = 0; i < block.itemCount_; i++) {
- elements[i] = Blockly.Python.valueToCode(block, 'ADD' + i,
- Blockly.Python.ORDER_NONE) || '___';
- }
- var code = '{' + elements.join(', ') + '}';
- return [code, Blockly.Python.ORDER_ATOMIC];
- }
|