Use conventional prefix/suffix for function calls.

Previously a function call with no return value generated:

  prefix();
  suffix();
  function();

The intent was so the prefix and suffix calls in the function body wouldn’t overlap with the prefix and suffix calls of the function call.  However, this is doomed to be inconsistent with a function call with a return value:

  prefix();
  print(function());
  suffix();

Thus since overlaping must exist, both types of function calls should have consistent suffix locations.
This commit is contained in:
Neil Fraser
2019-05-15 13:43:57 -07:00
committed by Neil Fraser
parent 475d8eb71f
commit e642a77f5d
6 changed files with 5 additions and 63 deletions

View File

@@ -642,12 +642,6 @@ Blockly.Blocks['procedures_callnoreturn'] = {
this.previousEnabledState_ = true;
},
/**
* Don't automatically add STATEMENT_PREFIX and STATEMENT_SUFFIX to generated
* code. These will be handled manually in this block's generators.
*/
suppressPrefixSuffix: true,
/**
* Returns the name of the procedure this block calls.
* @return {string} Procedure name.