Hello,
I think that your best bet would be to monkey-patch the core blocks (not something I generally recommend, but I think it would be safe here).
I'm not exactly sure what you mean by "I could update my block generators to set block.suppressPrefixSuffix = true to not add a suffix to the block if one of its parent is not a statement block" so I'll go over both possibilities =)
If you want to set the .suppressPrefixSuffix property to be true for all "for" blocks (for example) you can patch the block definition. For example:
```
// Put this somewhere near the rest of your block definitions.
// Should run *after* you load the built-in block definitions.
Blockly.Blocks['controls_repeat_ext'].supressPrefixSuffix = true;
```
If you want to set the .suppressPrefixSuffix property from within the block-code generator, you can just override the built-in generator to add that. For example:
```
Blockly.JavaScript['controls_repeat_ext'] = function(block) {
if (block.getField('TIMES')) {
var repeats = String(Number(block.getFieldValue('TIMES')));
} else {
var repeats = Blockly.JavaScript.valueToCode(block, 'TIMES',
Blockly.JavaScript.ORDER_ASSIGNMENT) || '0';
}
// etc...
code += 'for (var ' + loopVar + ' = 0; ' +
loopVar + ' < ' + endVar + '; ' +
loopVar + '++) {\n' +
branch + '}\n';
// Add your custom supressPrefixSuffix logic.
return code;
};
```
I hope that helps! If you have any further questions (or if I didn't understand your original question haha) please reply!
--Beka