1616 */
1717
1818/**
19- * @fileoverview This is a block that allows your code to use a parameter
20- * that is passed to a method.
19+ * @fileoverview This is a block that allows your code to jump to a specific step.
2120 * @author [email protected] (Alan Smith) 2221 */
2322import * as Blockly from 'blockly' ;
@@ -27,42 +26,42 @@ import {ExtendedPythonGenerator} from '../editor/extended_python_generator';
2726import { createFieldNonEditableText } from '../fields/FieldNonEditableText' ;
2827import { MRC_STYLE_VARIABLES } from '../themes/styles' ;
2928
30- export const BLOCK_NAME = 'mrc_advance_to_step ' ;
29+ export const BLOCK_NAME = 'mrc_jump_to_step ' ;
3130
3231const FIELD_STEP_NAME = 'STEP_NAME' ;
3332
34- type AdvanceToStepBlock = Blockly . Block & Blockly . BlockSvg & AdvanceToStepMixin ;
33+ type JumpToStepBlock = Blockly . Block & Blockly . BlockSvg & JumpToStepMixin ;
3534
36- interface AdvanceToStepMixin extends AdvanceToStepMixinType {
35+ interface JumpToStepMixin extends JumpToStepMixinType {
3736}
3837
39- type AdvanceToStepMixinType = typeof ADVANCE_TO_STEP_BLOCK ;
38+ type JumpToStepMixinType = typeof JUMP_TO_STEP_BLOCK ;
4039
41- const ADVANCE_TO_STEP_BLOCK = {
40+ const JUMP_TO_STEP_BLOCK = {
4241 /**
4342 * Block initialization.
4443 */
45- init : function ( this : AdvanceToStepBlock ) : void {
44+ init : function ( this : JumpToStepBlock ) : void {
4645 this . appendDummyInput ( )
47- . appendField ( 'Advance to step ' )
46+ . appendField ( 'Jump to' )
4847 . appendField ( createFieldNonEditableText ( '' ) , FIELD_STEP_NAME ) ;
4948 this . setPreviousStatement ( true , null ) ;
5049 this . setInputsInline ( true ) ;
5150 this . setStyle ( MRC_STYLE_VARIABLES ) ;
52- this . setTooltip ( 'Advance to the specified step when the condition is true .' ) ;
51+ this . setTooltip ( 'Jump to the specified step.' ) ;
5352 } ,
5453} ;
5554
5655export const setup = function ( ) {
57- Blockly . Blocks [ BLOCK_NAME ] = ADVANCE_TO_STEP_BLOCK ;
56+ Blockly . Blocks [ BLOCK_NAME ] = JUMP_TO_STEP_BLOCK ;
5857} ;
5958
6059export const pythonFromBlock = function (
61- block : AdvanceToStepBlock ,
60+ block : JumpToStepBlock ,
6261 _generator : ExtendedPythonGenerator ,
6362) {
6463 // TODO (Alan) : Specify the type here as well
65- const code = '# TODO: Advance to step ' + block . getFieldValue ( FIELD_STEP_NAME ) + '\n' ;
64+ const code = '# TODO: Jump to step ' + block . getFieldValue ( FIELD_STEP_NAME ) + '\n' ;
6665
6766 return [ code , Order . ATOMIC ] ;
6867} ;
0 commit comments