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§
Source§impl GetRange for Block
impl GetRange for Block
Source§fn get_range(&self) -> Result<Range, GetRangeError>
fn get_range(&self) -> Result<Range, GetRangeError>
Get the range of the node. This will only fail if
Cst.status is
AstStatus::HasErrors.Source§impl Ord for Block
impl Ord for Block
Source§impl<T: MatchesToken> ParseWithArgs<T> for Block
impl<T: MatchesToken> ParseWithArgs<T> for Block
Source§fn parse_with(
token: Token,
lexer: &mut Lexer<'_>,
errors: &mut Vec<ParseError>,
stop_at: T,
) -> Option<Self>
fn parse_with( token: Token, lexer: &mut Lexer<'_>, errors: &mut Vec<ParseError>, stop_at: T, ) -> Option<Self>
Try parsing the current item, starting from the passed token with the
passed arguments.
Source§impl PartialOrd for Block
impl PartialOrd for Block
impl Eq for Block
impl StructuralPartialEq for Block
Auto Trait Implementations§
impl Freeze for Block
impl RefUnwindSafe for Block
impl !Send for Block
impl !Sync for Block
impl Unpin 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