pub struct IfStatement {
pub if_keyword: Token,
pub condition: Pointer<Expression>,
pub then_keyword: Token,
pub body: Block,
pub else_if_statements: Vec<ElseIfStatement>,
pub else_statement: Option<ElseStatement>,
pub end_keyword: Token,
}Expand description
A struct representing an if statement
Fields§
§if_keyword: TokenThe if keyword.
condition: Pointer<Expression>The condition for this statement.
then_keyword: TokenThe then keyword.
body: BlockThe body that’ll be executed if condition is truthy.
else_if_statements: Vec<ElseIfStatement>Elseif branches.
else_statement: Option<ElseStatement>The else part of the if statement
end_keyword: TokenThe end keyword
Trait Implementations§
Source§impl Clone for IfStatement
impl Clone for IfStatement
Source§fn clone(&self) -> IfStatement
fn clone(&self) -> IfStatement
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IfStatement
impl Debug for IfStatement
Source§impl GetRange for IfStatement
impl GetRange for IfStatement
Source§impl Hash for IfStatement
impl Hash for IfStatement
Source§impl Ord for IfStatement
impl Ord for IfStatement
Source§fn cmp(&self, other: &IfStatement) -> Ordering
fn cmp(&self, other: &IfStatement) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl Parse for IfStatement
impl Parse for IfStatement
Source§impl PartialEq for IfStatement
impl PartialEq for IfStatement
Source§impl PartialOrd for IfStatement
impl PartialOrd for IfStatement
Source§impl Print for IfStatement
impl Print for IfStatement
Source§fn print_final_trivia(&self) -> String
fn print_final_trivia(&self) -> String
Prints only the very final trivia. Used for the default implementation of
Print::print, which just joins Print::print_without_final_trivia
and this function.Source§fn print_without_final_trivia(&self) -> String
fn print_without_final_trivia(&self) -> String
Prints the whole token including all surrounding trivia, excluding the
very last trailing trivia.
Source§impl TryParse for IfStatement
impl TryParse for IfStatement
impl Eq for IfStatement
impl StructuralPartialEq for IfStatement
Auto Trait Implementations§
impl Freeze for IfStatement
impl RefUnwindSafe for IfStatement
impl !Send for IfStatement
impl !Sync for IfStatement
impl Unpin for IfStatement
impl UnwindSafe for IfStatement
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