pub struct Lexer<'lex, 'src> { /* private fields */ }Implementations§
Source§impl<'lex, 'src> Lexer<'lex, 'src>
impl<'lex, 'src> Lexer<'lex, 'src>
Sourcepub fn new(
text: &'src str,
base_offset: usize,
em: &'lex mut ErrorManager,
) -> Self
pub fn new( text: &'src str, base_offset: usize, em: &'lex mut ErrorManager, ) -> Self
Builds a new Lexer
§Arguments
- text: Source code to tokenize
- em: An
ErrorManager, where all the errors will be sent
Sourcepub fn into_token_stream(self) -> TokenStream<'lex, 'src> ⓘ
pub fn into_token_stream(self) -> TokenStream<'lex, 'src> ⓘ
Turns this Lexer into a TokenStream
Sourcepub fn next_token(&mut self) -> Option<Token>
pub fn next_token(&mut self) -> Option<Token>
Parses the next token
Returns None if the EOF was reached
Trait Implementations§
Source§impl<'lex, 'src> IntoIterator for Lexer<'lex, 'src>
impl<'lex, 'src> IntoIterator for Lexer<'lex, 'src>
Auto Trait Implementations§
impl<'lex, 'src> Freeze for Lexer<'lex, 'src>
impl<'lex, 'src> !RefUnwindSafe for Lexer<'lex, 'src>
impl<'lex, 'src> !Send for Lexer<'lex, 'src>
impl<'lex, 'src> !Sync for Lexer<'lex, 'src>
impl<'lex, 'src> Unpin for Lexer<'lex, 'src>
impl<'lex, 'src> !UnwindSafe for Lexer<'lex, 'src>
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