pub struct Token { /* private fields */ }
Expand description
A token from the tokenizer
Implementations§
Source§impl Token
impl Token
Sourcepub const fn new(
symbol: Symbol,
source: Position,
parent: Option<Box<Self>>,
) -> Self
pub const fn new( symbol: Symbol, source: Position, parent: Option<Box<Self>>, ) -> Self
Create a new token
Sourcepub fn ending_newline(parent: Option<Box<Self>>) -> Self
pub fn ending_newline(parent: Option<Box<Self>>) -> Self
Create a newline token
Sourcepub fn set_parent(&mut self, parent: Option<Box<Self>>)
pub fn set_parent(&mut self, parent: Option<Box<Self>>)
Set the parent token
Sourcepub const fn word(&self) -> Option<&String>
pub const fn word(&self) -> Option<&String>
Get the string value of a Symbol::Word
token
Trait Implementations§
impl Eq for Token
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 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