public static final class Stmt.Return extends wybs.lang.SyntacticElement.Impl implements Stmt
ReturnStmt ::= "return" [Expression] NewLineThe optional expression is referred to as the return value. Note that, the returned expression (if there is one) must begin on the same line as the return statement itself. The following illustrates:
function f(int x) -> int:
return x + 1
Here, we see a simple return statement which returns an
int value.Stmt.Assert, Stmt.Assign, Stmt.Assume, Stmt.Break, Stmt.Case, Stmt.Continue, Stmt.Debug, Stmt.DoWhile, Stmt.Fail, Stmt.IfElse, Stmt.NamedBlock, Stmt.Return, Stmt.Skip, Stmt.Switch, Stmt.VariableDeclaration, Stmt.While| Constructor and Description |
|---|
Return(List<Expr> returns,
wybs.lang.Attribute... attributes)
Create a given return statement with an optional return value.
|
Return(List<Expr> returns,
Collection<wybs.lang.Attribute> attributes)
Create a given return statement with an optional return value.
|
public Return(List<Expr> returns, wybs.lang.Attribute... attributes)
expr - value being returned (may be null)attributes - public Return(List<Expr> returns, Collection<wybs.lang.Attribute> attributes)
expr - the return value, which may be null.attributes - Copyright © 2017. All rights reserved.