pub enum MultiStringToken<'input> {
Error,
Literal(String),
CandidateEnd(&'input str),
CandidateInterpolation(&'input str),
QuotesCandidateInterpolation(&'input str),
End,
Interpolation,
}Expand description
The tokens in multiline string mode.
Variants§
Error
Literal(String)
CandidateEnd(&'input str)
A candidate end. A multiline string starting delimiter MultiStringStart can have a
variable number of % character, so the lexer matches candidate end delimiter, compare the
number of characters, and either emit the End token above, or turn the CandidateEnd to a
FalseEnd otherwise
CandidateInterpolation(&'input str)
Same as CandidateEnd, but for interpolation
QuotesCandidateInterpolation(&'input str)
Unfortunate consequence of Logos’
issue#200. The other rules should be
sufficient to match this as a double quote followed by a CandidateInterpolation, but if we
omit this token, the lexer can fail unexpectedly on valid inputs because of #200.
End
Token emitted by the modal lexer for the parser once it has decided that a CandidateEnd is
an actual end token.
Interpolation
Trait Implementations§
Source§impl<'input> Clone for MultiStringToken<'input>
impl<'input> Clone for MultiStringToken<'input>
Source§fn clone(&self) -> MultiStringToken<'input>
fn clone(&self) -> MultiStringToken<'input>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'input> Debug for MultiStringToken<'input>
impl<'input> Debug for MultiStringToken<'input>
Source§impl<'s> Logos<'s> for MultiStringToken<'s>
impl<'s> Logos<'s> for MultiStringToken<'s>
Source§type Error = ()
type Error = ()
Error type returned by the lexer. This can be set using
#[logos(error = MyError)]. Defaults to () if not set.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>,
) -> Option<Result<Self, <Self as Logos<'s>>::Error>>
fn lex( lex: &mut Lexer<'s, Self>, ) -> Option<Result<Self, <Self as Logos<'s>>::Error>>
The heart of Logos. Called by the
Lexer. The implementation for this function
is generated by the logos-derive crate.Source§impl<'input> PartialEq for MultiStringToken<'input>
impl<'input> PartialEq for MultiStringToken<'input>
impl<'input> Eq for MultiStringToken<'input>
impl<'input> StructuralPartialEq for MultiStringToken<'input>
Auto Trait Implementations§
impl<'input> Freeze for MultiStringToken<'input>
impl<'input> RefUnwindSafe for MultiStringToken<'input>
impl<'input> Send for MultiStringToken<'input>
impl<'input> Sync for MultiStringToken<'input>
impl<'input> Unpin for MultiStringToken<'input>
impl<'input> UnsafeUnpin for MultiStringToken<'input>
impl<'input> UnwindSafe for MultiStringToken<'input>
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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