pub enum Stmt {
Empty,
Expr(Expr),
Assert(Expr),
Return(Option<Expr>),
Break,
Continue,
If {
cond: Expr,
then: Vec<Stmt>,
els: Vec<Stmt>,
},
While {
cond: Expr,
body: Vec<Stmt>,
},
For {
init: Vec<Expr>,
cond: Vec<Expr>,
step: Vec<Expr>,
body: Vec<Stmt>,
},
Block {
decls: Vec<BlockLocalDecl>,
body: Vec<Stmt>,
},
Decl(BlockLocalDecl),
Comment(String),
}Expand description
A statement of a function body (OtherStatement, parser.y:1045).
Variants§
Empty
The empty statement, ;.
Expr(Expr)
An expression evaluated for effect, e;.
Assert(Expr)
assert e; — UTAP’s assertion statement.
Return(Option<Expr>)
return e;, or return; when the function is void.
Break
break;.
Continue
continue;.
If
if (cond) { … } else { … }.
Fields
While
while (cond) { … }.
For
for (init; cond; step) { … }.
Fields
Block
A nested block, with its own block-local declarations.
Fields
§
decls: Vec<BlockLocalDecl>Block-local declarations, which must precede every statement.
Decl(BlockLocalDecl)
A block-local declaration in statement position.
Comment(String)
A comment line, printed as // text; an opaque foreign call is one.
Trait Implementations§
impl StructuralPartialEq for Stmt
Auto Trait Implementations§
impl Freeze for Stmt
impl RefUnwindSafe for Stmt
impl Send for Stmt
impl Sync for Stmt
impl Unpin for Stmt
impl UnsafeUnpin for Stmt
impl UnwindSafe for Stmt
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.