Go to the first, previous, next, last section, table of contents.


Jumps and returns

return_expression:
          `=' [expression]
        | `return' [expression]
        ;

A return_expression sets the current notion of the return value of the current method and, if the return variant is used, terminates execution of the method. The value of a return_expression is the value of the expression, or void if expression is omitted.

[Note: return without an expression should mean to terminate execution of the current method, without modifying the current notion of the return value of the method. End note.]

jump_expression:
          break_expression
        | continue_expression
        ;

(The kind of return_expression with the return keyword also jumps but is considered more of a return_expression than a jump_expression.)

break_expression:
          `break' [expression]
        ;

The break_expression terminates the enclosing loop. If the expression is provided, its value will be the value of the loop. If it is omitted, the value of the loop will be void.

[Note: It should be possible to break out of a loop different from the enclosing loop. Obviously, the indication of which loop should be static, i.e. something like `computed break' should not be possible in the language; catch and throw can be misused for that purpose. End note. ]

continue_expression:
          `continue' [expression]
        ;

The continue_expression skips the remainder of the body of the enclosing loop, continuing execution with the loop condition (preceded by the loop modifier expression in case of a for loop). The value of the loop, if it were to fail its condition, will be the value of the expression. If omitted, the value of the loop will be void.


Go to the first, previous, next, last section, table of contents.