pub enum Stmt {
Show 15 variants
Assembly(StmtAssembly),
Block(Block),
Break(StmtBreak),
Continue(StmtContinue),
DoWhile(StmtDoWhile),
Emit(StmtEmit),
Expr(StmtExpr),
For(StmtFor),
If(StmtIf),
Return(StmtReturn),
Revert(StmtRevert),
Try(StmtTry),
UncheckedBlock(UncheckedBlock),
VarDecl(StmtVarDecl),
While(StmtWhile),
}
Expand description
A statement, usually ending in a semicolon.
Solidity reference: https://docs.soliditylang.org/en/latest/grammar.html#a4.SolidityParser.statement
Variants§
Assembly(StmtAssembly)
An assembly block, with optional flags: assembly "evmasm" { ... }
.
Block(Block)
A blocked scope: { ... }
.
Break(StmtBreak)
A break statement: break;
.
Continue(StmtContinue)
A continue statement: continue;
.
DoWhile(StmtDoWhile)
A do-while statement: do { ... } while (condition);
.
Emit(StmtEmit)
An emit statement: emit FooBar(42);
.
Expr(StmtExpr)
An expression with a trailing semicolon.
For(StmtFor)
A for statement: for (uint256 i; i < 42; ++i) { ... }
.
If(StmtIf)
An if
statement with an optional else
block: if (expr) { ... } else { ... }
.
Return(StmtReturn)
A return statement: return 42;
.
Revert(StmtRevert)
A revert statement: revert("error");
.
Try(StmtTry)
A try statement: try fooBar(42) catch { ... }
.
UncheckedBlock(UncheckedBlock)
An unchecked block: unchecked { ... }
.
VarDecl(StmtVarDecl)
A variable declaration statement: uint256 foo = 42;
.
While(StmtWhile)
A while statement: while (i < 42) { ... }
.