pub struct TokenWithSourceref<C: CharType> {
pub base: BaseToken<C>,
pub sourceref: Option<SourceReference<Self>>,
}
Expand description
A Token
bundling a BaseToken
with a SourceReference
.
Fields§
§base: BaseToken<C>
The actual TeX-relevant data of the Token
sourceref: Option<SourceReference<Self>>
The SourceReference
of the Token
Trait Implementations§
Source§impl<C: Clone + CharType> Clone for TokenWithSourceref<C>
impl<C: Clone + CharType> Clone for TokenWithSourceref<C>
Source§fn clone(&self) -> TokenWithSourceref<C>
fn clone(&self) -> TokenWithSourceref<C>
Returns a copy 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<C: CharType> Debug for TokenWithSourceref<C>
impl<C: CharType> Debug for TokenWithSourceref<C>
Source§impl<C: CharType> Display for TokenWithSourceref<C>
impl<C: CharType> Display for TokenWithSourceref<C>
Source§impl<Char: CharType> Mouth<TokenWithSourceref<Char>> for TracingMouth<Char>
impl<Char: CharType> Mouth<TokenWithSourceref<Char>> for TracingMouth<Char>
fn new() -> Self
Source§fn push_tokens(&mut self, tks: Vec<TokenWithSourceref<Char>>)
fn push_tokens(&mut self, tks: Vec<TokenWithSourceref<Char>>)
Source§fn requeue(&mut self, tk: TokenWithSourceref<Char>)
fn requeue(&mut self, tk: TokenWithSourceref<Char>)
fn has_next<S: State<TokenWithSourceref<Char>>>( &mut self, state: &S, ) -> Result<bool, InvalidCharacter<TokenWithSourceref<Char>>>
Source§fn get_next<S: State<TokenWithSourceref<Char>>>(
&mut self,
s: &S,
) -> Result<Option<(TokenWithSourceref<Char>, bool)>, InvalidCharacter<TokenWithSourceref<Char>>>
fn get_next<S: State<TokenWithSourceref<Char>>>( &mut self, s: &S, ) -> Result<Option<(TokenWithSourceref<Char>, bool)>, InvalidCharacter<TokenWithSourceref<Char>>>
Source§fn get_next_nopar<S: State<T>>(
&mut self,
state: &S,
) -> Result<Option<(T, bool)>, Box<dyn TeXError<T>>>
fn get_next_nopar<S: State<T>>( &mut self, state: &S, ) -> Result<Option<(T, bool)>, Box<dyn TeXError<T>>>
Source§fn skip_whitespace<S: State<T>>(
&mut self,
state: &S,
) -> Result<(), InvalidCharacter<T>>
fn skip_whitespace<S: State<T>>( &mut self, state: &S, ) -> Result<(), InvalidCharacter<T>>
Skip whitespace characters from the
Mouth
Source§fn skip_eq_char<S: State<T>>(
&mut self,
state: &S,
) -> Result<(), InvalidCharacter<T>>
fn skip_eq_char<S: State<T>>( &mut self, state: &S, ) -> Result<(), InvalidCharacter<T>>
read optional
=
characters from the Mouth
Source§fn read_argument<S: State<T>>(
&mut self,
state: &S,
) -> Result<Vec<T>, Box<dyn TeXError<T>>>
fn read_argument<S: State<T>>( &mut self, state: &S, ) -> Result<Vec<T>, Box<dyn TeXError<T>>>
reads a macro argument from the
Mouth
, i.e. a sequence of Token
s enclosed in
braces (category codes BeginGroup
and
EndGroup
), or a single non-space Token
if the argument is
not enclosed.Source§impl<C: CharType> PartialEq for TokenWithSourceref<C>
impl<C: CharType> PartialEq for TokenWithSourceref<C>
Source§impl<C: CharType> Token for TokenWithSourceref<C>
impl<C: CharType> Token for TokenWithSourceref<C>
type Char = C
Source§fn new(
base: BaseToken<C>,
sourceref: Option<(Ptr<String>, (usize, usize), (usize, usize))>,
) -> Self
fn new( base: BaseToken<C>, sourceref: Option<(Ptr<String>, (usize, usize), (usize, usize))>, ) -> Self
Source§fn with_ref(&self, token: &Ptr<Self>, cmd: &Ptr<Command<Self>>) -> Self
fn with_ref(&self, token: &Ptr<Self>, cmd: &Ptr<Command<Self>>) -> Self
Clone this
Token
with a new SourceReference
of type SourceReference::Expansion
(if the Token
is a TokenWithSourceref
).fn sourceref_trace(&self) -> Option<String>
Source§fn from_str(s: String) -> Vec<Self>
fn from_str(s: String) -> Vec<Self>
Parse a string into a list of
Token
s of CategoryCode::Other
Source§fn catcode(&self) -> CategoryCode
fn catcode(&self) -> CategoryCode
The
CategoryCode
of the Token
Auto Trait Implementations§
impl<C> Freeze for TokenWithSourceref<C>where
C: Freeze,
impl<C> RefUnwindSafe for TokenWithSourceref<C>where
C: RefUnwindSafe,
impl<C> !Send for TokenWithSourceref<C>
impl<C> !Sync for TokenWithSourceref<C>
impl<C> Unpin for TokenWithSourceref<C>where
C: Unpin,
impl<C> UnwindSafe for TokenWithSourceref<C>where
C: UnwindSafe + RefUnwindSafe,
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