I know that I can use
Blockly.JavaScript['my_code'] = function() { ... }
But how can I add another language support like JSON? I tried ..
Blockly.Json['my_code'] = function() { ... }
It fails when I try to recover
Blockly.Json.workspaceToCode(this.workspace)
workspaceToCode is not a function.
I need to add a new language to Blockly
I will not display this new language (JSON), it will just be used to send instructions to the robots.
I try to
Blockly.Json = new Blockly.Generator('Json');
Blockly.Json['my_code'] = function() { ... }
But an error occurs in
Blockly.Json.workspaceToCode(this.workspace)
Error ..
Uncaught TypeError: this.init is not a function
at js.ou3v.module.exports.Blockly.Generator.workspaceToCode