Respect generator.INDENT setting. Issue #331.

This commit is contained in:
Neil Fraser
2016-04-14 01:14:37 -07:00
parent 8c3de3a581
commit bd779ad938
4 changed files with 26 additions and 19 deletions

View File

@@ -79,16 +79,15 @@ Blockly.Python.ORDER_CONDITIONAL = 15; // if else
Blockly.Python.ORDER_LAMBDA = 16; // lambda
Blockly.Python.ORDER_NONE = 99; // (...)
/**
* Empty loops or conditionals are not allowed in Python.
*/
Blockly.Python.PASS = ' pass\n';
/**
* Initialise the database of variable names.
* @param {!Blockly.Workspace} workspace Workspace to generate code from.
*/
Blockly.Python.init = function(workspace) {
/**
* Empty loops or conditionals are not allowed in Python.
*/
Blockly.Python.PASS = this.INDENT + 'pass\n';
// Create a dictionary of definitions to be printed before the code.
Blockly.Python.definitions_ = Object.create(null);
// Create a dictionary mapping desired function names in definitions_