pub enum VyperStmt {
Show 17 variants
VarDecl(String, VyperType, Option<VyperExpr>),
Assign(VyperExpr, VyperExpr),
AugAssign(String, VyperExpr, VyperExpr),
ExprStmt(VyperExpr),
Return(Option<VyperExpr>),
If(VyperExpr, Vec<VyperStmt>, Vec<VyperStmt>),
ForRange(String, VyperType, VyperExpr, Vec<VyperStmt>),
ForIn(String, VyperType, VyperExpr, Vec<VyperStmt>),
Log(String, Vec<VyperExpr>),
Assert(VyperExpr, Option<String>),
Raise(String),
Pass,
Break,
Continue,
Send(VyperExpr, VyperExpr),
SelfDestruct(VyperExpr),
Comment(String),
}Expand description
Vyper statement AST node.
Variants§
VarDecl(String, VyperType, Option<VyperExpr>)
name: T = expr
Assign(VyperExpr, VyperExpr)
lhs = rhs
AugAssign(String, VyperExpr, VyperExpr)
lhs += rhs / lhs -= rhs / etc.
ExprStmt(VyperExpr)
expr (function call as statement)
Return(Option<VyperExpr>)
return expr
If(VyperExpr, Vec<VyperStmt>, Vec<VyperStmt>)
if cond:\n body\nelse:\n else_
ForRange(String, VyperType, VyperExpr, Vec<VyperStmt>)
for var: T in range(n):\n body
ForIn(String, VyperType, VyperExpr, Vec<VyperStmt>)
for var: T in array:\n body
Log(String, Vec<VyperExpr>)
log EventName(args...)
Assert(VyperExpr, Option<String>)
assert cond, msg
Raise(String)
raise "msg"
Pass
pass
Break
break
Continue
continue
Send(VyperExpr, VyperExpr)
send(addr, amount)
SelfDestruct(VyperExpr)
selfdestruct(to)
Comment(String)
Multi-line comment block (emitted as # comment)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VyperStmt
impl RefUnwindSafe for VyperStmt
impl Send for VyperStmt
impl Sync for VyperStmt
impl Unpin for VyperStmt
impl UnsafeUnpin for VyperStmt
impl UnwindSafe for VyperStmt
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more