mirror of
https://github.com/google/blockly.git
synced 2026-01-09 01:50:11 +01:00
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:
committed by
Neil Fraser
parent
105f0da3d2
commit
04d6d119c0
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user