pub enum Lexeme<'a> {
BracketClose,
BracketOpen,
Comment(usize, &'a str),
Dot,
ParenClose,
ParenOpen,
Quote,
Quasiquote,
String(Gc<String>),
Symbolish(&'a str),
Unquote(bool),
}
Expand description
The unit of lexical syntax.
Variants§
BracketClose
An closing bracket.
BracketOpen
An opening bracket.
Comment(usize, &'a str)
A comment. The numeric parameter is the number of “extra” semicolons used.
For example, the comment
;; foo
would become:
Lexeme::Comment(1, " foo")
Dot
A center dot (U+2022), which is used for dotted pairs.
ParenClose
An closing parenthesis.
ParenOpen
An opening parenthesis.
Quote
A single quote.
Quasiquote
A backtick.
String(Gc<String>)
A string.
Symbolish(&'a str)
A symbol or number. The disambiguation is performed when constructing
the CST (the Vec<Value>
).
Unquote(bool)
A comma, possibly followed by an at-sign. The value is true
if ,@
was read, false
for just ,
.
Trait Implementations§
impl<'a> Eq for Lexeme<'a>
impl<'a> StructuralPartialEq for Lexeme<'a>
Auto Trait Implementations§
impl<'a> !Freeze for Lexeme<'a>
impl<'a> !RefUnwindSafe for Lexeme<'a>
impl<'a> !Send for Lexeme<'a>
impl<'a> !Sync for Lexeme<'a>
impl<'a> Unpin for Lexeme<'a>
impl<'a> !UnwindSafe for Lexeme<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more