Add indexing setting for JavaScript Generation (#419)

Adding setting to allow for switching between zero and one based indexing for Blockly Blocks such that the generated code will use this flag to determine whether one based or zero based indexing should be used. One based indexing is enabled by default.
This commit is contained in:
Monica Kozbial
2016-06-09 18:09:37 -07:00
committed by Neil Fraser
parent 105f0da3d2
commit 04d6d119c0

View File

@@ -103,6 +103,12 @@ Blockly.JavaScript.ORDER_ASSIGNMENT = 16; // = += -= *= /= %= <<= >>= ...
Blockly.JavaScript.ORDER_COMMA = 17; // ,
Blockly.JavaScript.ORDER_NONE = 99; // (...)
/**
* Allow for switching between one and zero based indexing, one based by
* default.
*/
Blockly.JavaScript.ONE_BASED_INDEXING = true;
/**
* Initialise the database of variable names.
* @param {!Blockly.Workspace} workspace Workspace to generate code from.