Hello,
I'm not 100% sure I understand your code; I can't read the alphabet the blocks in your screenshot are labelled with, so I have to match them up against the definitions by shape and hex colour (which do not match exactly any of the colours actually shown in the picture), so I might be confused, but I notice two issues;
- Both the 'menu' and 'submenu' blocks each have both a field and an input named 'NAME'. There's nothing strictly _wrong_ with this—inputs and fields have different namespaces—but it is definitely confusing.
- The generator function for the 'Pdtmf1' block calls javascriptGenerator.statementToCode(block, 'STATEMENTS'), but this block does not have any input named 'STATEMENTS', only one called 'NAME'.
I think both issues can be fixed by changing this.appendStatementInput('NAME') to this.appendStatementInput('STATEMENTS') in the block definitions for 'menu' and 'submenu'.
By the way: I think it is unhelpful that CodeGenerator.prototype.statementToCode returns an empty string when given a non-existent input name; I think it would have been easier for you if it had thrown an error, so I've filed a feature request suggesting that we change this.
Best wishes,
Christopher