123456789101112131415 |
- 'use strict';
- goog.provide('Blockly.Python.comprehensions');
- goog.require('Blockly.Python');
- Blockly.Python['list_comprehension'] = function(block) {
- var value_body = Blockly.Python.valueToCode(block, 'body', Blockly.Python.ORDER_ATOMIC) || '___';
- var value_var = Blockly.Python.valueToCode(block, 'var', Blockly.Python.ORDER_ATOMIC) || '___';
- var value_list = Blockly.Python.valueToCode(block, 'list', Blockly.Python.ORDER_ATOMIC) || '___';
- // TODO: Assemble Python into code variable.
- var code = '['+value_body+' for '+value_var+' in '+value_list+']';
- // TODO: Change ORDER_NONE to the correct strength.
- return [code, Blockly.Python.ORDER_NONE];
- };
|