pub enum Stmt {
Expression(ExpressionData),
Function(FunctionData),
If(IfData),
Print(PrintData),
Return(ReturnData),
Break(BreakData),
Var(VarData),
While(WhileData),
Block(BlockData),
Class(ClassData),
}Expand description
Represents a statement in the language.
Variants§
Expression(ExpressionData)
An expression statement.
This is the only statement that evaluates to a value.
Function(FunctionData)
If(IfData)
An if statement. This is used to conditionally execute a statement.
Print(PrintData)
A print statement. This is used to print a value to the standard output.
Return(ReturnData)
A return statement. This is used to return from a function (optionally with a value).
Break(BreakData)
A break statement. This is used to break out of a loop.
Var(VarData)
A var statement. This is used to declare a variable.
While(WhileData)
A while statement. This is used to conditionally execute a statement repeatedly.
Block(BlockData)
A block statement. This is used to group statements together like a function body.
Class(ClassData)
A class statement. This is used to declare a class.
Implementations§
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 UnwindSafe for Stmt
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