frontend / entities/blocks/baseBlocks / initBaseBlocks
Function: initBaseBlocks()
initBaseBlocks(
generator,mode):void
Defined in: entities/blocks/baseBlocks.ts:26
Registers Python generators for all base blocks on given generator instance.
Should be called once before first use of generator. If called again on same instance, handlers are just overwritten with new ones.
Parameters
generator
PythonGenerator
Python generator which will get new block handlers.
mode
"display" | "execution"
Current mode of generator. In "execution" mode some blocks can generate extra code (for example stop-check inside loops), in "display" mode code is only for preview and should stay readable. Right now both modes produce same result, parameter is reserved for future use.
Returns
void