pub struct SpannedToken {
pub token: PrattToken,
pub start: usize,
pub end: usize,
pub leading_trivia: Vec<Trivia>,
}Expand description
A Pratt token paired with its byte span and the trivia (whitespace and comments) that preceded it, so source layout can be reconstructed on encode.
Fields§
§token: PrattTokenThe scanned token.
start: usizeByte offset where the token starts in the source.
end: usizeByte offset just past the end of the token.
leading_trivia: Vec<Trivia>Whitespace and comment trivia immediately preceding the token.
Trait Implementations§
Source§impl Clone for SpannedToken
impl Clone for SpannedToken
Source§fn clone(&self) -> SpannedToken
fn clone(&self) -> SpannedToken
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SpannedToken
impl Debug for SpannedToken
impl Eq for SpannedToken
Source§impl PartialEq for SpannedToken
impl PartialEq for SpannedToken
Source§fn eq(&self, other: &SpannedToken) -> bool
fn eq(&self, other: &SpannedToken) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SpannedToken
Auto Trait Implementations§
impl Freeze for SpannedToken
impl RefUnwindSafe for SpannedToken
impl Send for SpannedToken
impl Sync for SpannedToken
impl Unpin for SpannedToken
impl UnsafeUnpin for SpannedToken
impl UnwindSafe for SpannedToken
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