pub struct Token { /* private fields */ }Expand description
This represents the smallest individual words, phrases, or characters that JavaScript can understand.
More information:
Implementations§
Source§impl Token
impl Token
Sourcepub const fn new(kind: TokenKind, span: Span, linear_span: LinearSpan) -> Self
pub const fn new(kind: TokenKind, span: Span, linear_span: LinearSpan) -> Self
Create a new detailed token from the token data, line number, column number, and linear position
Sourcepub fn new_by_position_group(
kind: TokenKind,
start: PositionGroup,
end: PositionGroup,
) -> Self
pub fn new_by_position_group( kind: TokenKind, start: PositionGroup, end: PositionGroup, ) -> Self
Create a new detailed token from the token data, line number and column number
Sourcepub const fn start_group(&self) -> PositionGroup
pub const fn start_group(&self) -> PositionGroup
Gets the starting position group of the token.
Sourcepub const fn linear_span(&self) -> LinearSpan
pub const fn linear_span(&self) -> LinearSpan
Gets the token span in the original source code.
Trait Implementations§
impl StructuralPartialEq for Token
Auto Trait Implementations§
impl Freeze for Token
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnsafeUnpin for Token
impl UnwindSafe for Token
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