Struct lrlex::LRNonStreamingLexer [−][src]
pub struct LRNonStreamingLexer<'lexer, 'input: 'lexer, LexemeT, StorageT: Debug> { /* fields omitted */ }
Expand description
An LRNonStreamingLexer
holds a reference to a string and can lex it into lrpar::Lexemes.
Although the struct is tied to a single string, no guarantees are made about whether the
lexemes are cached or not.
Implementations
Create a new LRNonStreamingLexer
that read in: the input s
; and derived lexemes
and
newlines
. The newlines
Vec<usize>
is a sorted list of the byte index of the start of
the following line. i.e. for the input string " a\nb\n c d"
the Vec
should contain
[3, 5]
.
Note that if one or more lexemes or newlines was not created from s
, subsequent calls to
the LRNonStreamingLexer
may cause panic
s.
Trait Implementations
impl<'lexer, 'input: 'lexer, LexemeT: Lexeme<StorageT>, StorageT: Copy + Eq + Debug + Hash + PrimInt + Unsigned> NonStreamingLexer<'input, LexemeT, StorageT> for LRNonStreamingLexer<'lexer, 'input, LexemeT, StorageT>
impl<'lexer, 'input: 'lexer, LexemeT: Lexeme<StorageT>, StorageT: Copy + Eq + Debug + Hash + PrimInt + Unsigned> NonStreamingLexer<'input, LexemeT, StorageT> for LRNonStreamingLexer<'lexer, 'input, LexemeT, StorageT>
Return the lines containing the input at span
(including all the text on the lines
that span
starts and ends on). Read more