Use a comment block for function comments in generated JS, Python and Dart.

This commit is contained in:
Neil Fraser
2016-06-06 00:19:36 -07:00
parent 87e4e6224a
commit 4ba2b1bea3
3 changed files with 20 additions and 3 deletions

View File

@@ -176,7 +176,12 @@ Blockly.Python.scrub_ = function(block, code) {
// Collect comment for this block.
var comment = block.getCommentText();
if (comment) {
commentCode += Blockly.Python.prefixLines(comment, '# ') + '\n';
if (block.getProcedureDef) {
// Use a comment block for function comments.
commentCode += '"""' + comment + '\n"""\n';
} else {
commentCode += Blockly.Python.prefixLines(comment + '\n', '# ');
}
}
// Collect comments for all value arguments.
// Don't collect comments for nested statements.