Return from procedure/function

  return_from_procedure = `return' <return>
  return_from_function = `return' [expression <assign_to_result>] <return>

Returning early from a call to a procedure or function is similar to an exit from a loop: The return instruction is translated into an assignment to a global flag, followed by a return instruction in the target language. If the procedure/function body is interpreted, the Walk_instructions routine must check the flag after every instruction.

Early returns from functions usually involve an expression specifying the result of the call. This can be implemented as an assignment to a result variable accessible to the method implementing the function call. The easiest way to handle this is to rewrite the AST so that a return instruction with return value expression ends up as an assignment instruction followed by a return instruction.