pub enum Token<S> {
}Expand description
A token generated by the lexer.
Variants§
Def
definition
Thm
theorem
LBrk
opening bracket
RBrk
closing bracket
LPar
opening parenthesis
RPar
closing parenthesis
Colon
has type
ColonEq
is defined as
Arrow
product
FatArrow
abstraction
LongArrow
rewrites to
Comma
separate variables in rewrite rule contexts
Dot
terminate command
Symb(Symb<S>)
symbol
Comment(usize)
unclosed comments (the number indicates how many comments are still open)
Error
unrecognised token
Trait Implementations§
Source§impl<'s> Logos<'s> for Token<&'s str>
impl<'s> Logos<'s> for Token<&'s str>
Source§type Extras = ()
type Extras = ()
Associated type
Extras for the particular lexer. This can be set using
#[logos(extras = MyExtras)] and accessed inside callbacks.Source§type Source = str
type Source = str
Source type this token can be lexed from. This will default to
str,
unless one of the defined patterns explicitly uses non-unicode byte values
or byte slices, in which case that implementation will use [u8].Source§fn lex(lex: &mut Lexer<'s, Self>)
fn lex(lex: &mut Lexer<'s, Self>)
The heart of Logos. Called by the
Lexer. The implementation for this function
is generated by the logos-derive crate.impl<S: Eq> Eq for Token<S>
impl<S> StructuralPartialEq for Token<S>
Auto Trait Implementations§
impl<S> Freeze for Token<S>where
S: Freeze,
impl<S> RefUnwindSafe for Token<S>where
S: RefUnwindSafe,
impl<S> Send for Token<S>where
S: Send,
impl<S> Sync for Token<S>where
S: Sync,
impl<S> Unpin for Token<S>where
S: Unpin,
impl<S> UnwindSafe for Token<S>where
S: UnwindSafe,
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