pub struct Block {
pub statements: Vec<(Pointer<Statement>, Option<Token>)>,
pub last_statement: Option<(Pointer<TerminationStatement>, Option<Token>)>,
}Expand description
A block of code that represents a single scope (and nested ones).
Fields§
§statements: Vec<(Pointer<Statement>, Option<Token>)>The tokens in the of this block only. Parent
blocks’ tokens won’t be included. The optional Token
is the optional semicolon after the statement.
last_statement: Option<(Pointer<TerminationStatement>, Option<Token>)>The last statement (aka termination statement)
of this scope. The optional Token is the optional semicolon after the
statement.
Implementations§
Trait Implementations§
impl Eq for Block
Source§impl Ord for Block
impl Ord for Block
1.21.0 (const: unstable) · 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<T: MatchesToken> ParseWithArgs<T> for Block
impl<T: MatchesToken> ParseWithArgs<T> for Block
Source§impl PartialOrd for Block
impl PartialOrd for Block
Source§impl Print for Block
impl Print for Block
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 StructuralPartialEq for Block
Auto Trait Implementations§
impl !Send for Block
impl !Sync for Block
impl Freeze for Block
impl RefUnwindSafe for Block
impl Unpin for Block
impl UnsafeUnpin for Block
impl UnwindSafe for Block
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