pub enum Stmt {
Show 20 variants
Empty(Span),
Block(Block),
Labeled(LabeledStmt),
Expr(ExprStmt),
LocalVarDecl(LocalVarDeclStmt),
If(IfStmt),
Assert(AssertStmt),
Switch(SwitchStmt),
While(WhileStmt),
DoWhile(DoWhileStmt),
For(ForStmt),
EnhancedFor(EnhancedForStmt),
Break(JumpStmt),
Continue(JumpStmt),
Return(ReturnStmt),
Throw(ThrowStmt),
Synchronized(SynchronizedStmt),
Try(TryStmt),
Yield(YieldStmt),
ClassDecl(Box<TypeDecl>),
}Expand description
A Java statement.
Variants§
Empty(Span)
An empty statement: ;
Block(Block)
A block: { ... }
Labeled(LabeledStmt)
A labeled statement: label: stmt
Expr(ExprStmt)
An expression statement: expr;
LocalVarDecl(LocalVarDeclStmt)
A local variable declaration: int x = 5;
If(IfStmt)
An if statement: if (cond) stmt [else stmt]
Assert(AssertStmt)
An assert statement: assert cond [: detail];
Switch(SwitchStmt)
A switch statement: switch (expr) { ... }
While(WhileStmt)
A while statement: while (cond) stmt
DoWhile(DoWhileStmt)
A do-while statement: do stmt while (cond);
For(ForStmt)
A for statement: for (init; cond; update) stmt
EnhancedFor(EnhancedForStmt)
An enhanced for statement: for (Type var : iterable) stmt
Break(JumpStmt)
A break statement: break [label];
Continue(JumpStmt)
A continue statement: continue [label];
Return(ReturnStmt)
A return statement: return [expr];
Throw(ThrowStmt)
A throw statement: throw expr;
Synchronized(SynchronizedStmt)
A synchronized statement: synchronized (lock) { ... }
Try(TryStmt)
A try statement: try { ... } catch (...) { ... } [finally { ... }]
Yield(YieldStmt)
A yield statement: yield expr; (in switch expressions)
ClassDecl(Box<TypeDecl>)
A local class or interface declaration.