pub trait SourceTokenProvider {
// Required method
fn source_tokens(&self) -> &[(Token, ByteRange<usize>)];
}Expand description
Trait that any token structure can implement to provide access to source tokens.
This enables the unrolling system to work with any parser’s token representation.
Required Methods§
Sourcefn source_tokens(&self) -> &[(Token, ByteRange<usize>)]
fn source_tokens(&self) -> &[(Token, ByteRange<usize>)]
Get the original Logos tokens that comprise this token.
For atomic tokens (direct from Logos), this returns a slice containing just that token. For aggregate tokens (from transformations), this returns all the original tokens.