pub enum CStmt {
Show 13 variants
VarDecl {
ty: CType,
name: String,
init: Option<CExpr>,
},
Assign(CExpr, CExpr),
If {
cond: CExpr,
then_body: Vec<CStmt>,
else_body: Vec<CStmt>,
},
Switch {
scrutinee: CExpr,
cases: Vec<(u32, Vec<CStmt>)>,
default: Vec<CStmt>,
},
While {
cond: CExpr,
body: Vec<CStmt>,
},
Return(Option<CExpr>),
Block(Vec<CStmt>),
Expr(CExpr),
Comment(String),
Blank,
Label(String),
Goto(String),
Break,
}Expand description
C statement for code generation.
Variants§
VarDecl
Variable declaration: type name = init;
Assign(CExpr, CExpr)
Assignment: lhs = rhs;
If
If-else statement.
Switch
Switch statement.
While
While loop.
Return(Option<CExpr>)
Return statement.
Block(Vec<CStmt>)
Block (compound statement).
Expr(CExpr)
Expression statement.
Comment(String)
Comment.
Blank
Blank line (for readability).
Label(String)
Label for goto.
Goto(String)
Goto statement.
Break
Break statement.
Trait Implementations§
impl StructuralPartialEq for CStmt
Auto Trait Implementations§
impl Freeze for CStmt
impl RefUnwindSafe for CStmt
impl Send for CStmt
impl Sync for CStmt
impl Unpin for CStmt
impl UnsafeUnpin for CStmt
impl UnwindSafe for CStmt
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