Struct gluon_parser::lexer::Lexer
[−]
[src]
pub struct Lexer<'input, I> where I: RangeStream<Item=char, Range=&'input str> { pub env: LanguageEnv<'input, LocatedStream<I>>, pub input: Option<LocatedStream<I>>, pub unprocessed_tokens: Vec<SpannedToken<&'input str>>, pub indent_levels: Contexts, // some fields omitted }
Fields
env: LanguageEnv<'input, LocatedStream<I>>
input: Option<LocatedStream<I>>
unprocessed_tokens: Vec<SpannedToken<&'input str>>
indent_levels: Contexts
Methods
impl<'input, I> Lexer<'input, I> where I: RangeStream<Item=char, Range=&'input str> + 'input, I::Range: Debug + 'input
[src]
fn new(input: I) -> Lexer<'input, I>
fn next_token(&mut self) -> SpannedToken<&'input str>
Trait Implementations
impl<'input, I> StreamOnce for Lexer<'input, I> where I: RangeStream<Item=char, Range=&'input str> + 'input, I::Range: Debug
[src]
type Item = Token<&'input str>
The type of items which is yielded from this stream
type Range = Token<&'input str>
The type of a range of items yielded from this stream. Types which do not a have a way of yielding ranges of items should just use the Self::Item for this type Read more
type Position = Span<Location>
Type which represents the position in a stream. Ord is required to allow parsers to determine which of two positions are further ahead. Read more
fn uncons(&mut self) -> Result<Token<&'input str>, Error<&'input str>>
Takes a stream and removes its first item, yielding the item and the rest of the elements Returns Err
if no element could be retrieved Read more
fn position(&self) -> Self::Position
Returns the current position of the stream