pub enum TerminationStatement {
Break(Token),
Continue(Token),
Return {
return_keyword: Token,
expressions: Option<List<Pointer<Expression>>>,
},
}Expand description
An enum representing different types of statements that can end a block of code. These statements may or may not be present.
Variants§
Break(Token)
The break keyword.
breakContinue(Token)
The continue keyword.
continueReturn
A return statement. Can be in multiple forms:
return
-- or
return value
-- or
return value1, value2, ...Trait Implementations§
Source§impl Clone for TerminationStatement
impl Clone for TerminationStatement
Source§fn clone(&self) -> TerminationStatement
fn clone(&self) -> TerminationStatement
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 TerminationStatement
impl Debug for TerminationStatement
Source§impl GetRange for TerminationStatement
impl GetRange for TerminationStatement
Source§impl Hash for TerminationStatement
impl Hash for TerminationStatement
Source§impl Ord for TerminationStatement
impl Ord for TerminationStatement
Source§fn cmp(&self, other: &TerminationStatement) -> Ordering
fn cmp(&self, other: &TerminationStatement) -> 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 TerminationStatement
impl Parse for TerminationStatement
Source§impl PartialEq for TerminationStatement
impl PartialEq for TerminationStatement
Source§impl PartialOrd for TerminationStatement
impl PartialOrd for TerminationStatement
Source§impl Print for TerminationStatement
impl Print for TerminationStatement
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.
impl Eq for TerminationStatement
impl StructuralPartialEq for TerminationStatement
Auto Trait Implementations§
impl Freeze for TerminationStatement
impl RefUnwindSafe for TerminationStatement
impl !Send for TerminationStatement
impl !Sync for TerminationStatement
impl Unpin for TerminationStatement
impl UnwindSafe for TerminationStatement
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