/// Produces the next token in the source input.
///
/// Takes cares of errors and generating the correct source span
/// of the token.
Produces the next token in the source input.
Takes cares of errors and generating the correct source span
of the token.
Produces the next token in the source input . Takes cares of errors and generating the correct source span of the token .
fn bump_token(&mut self) -> Option<SpannedToken> {
        while let Some((token, delta)) = self.lookahead() {
            let span = self.shift_location(delta);
            match token {
                PlexToken::EOF => {
                    self.receive_eof();
                    break;
                }
                PlexToken::Error(placeholder, plex_err) => {
                    let err = plex_err.into_lexer_error(span);
                    self.errors.push(err);
                    return Some(spanned(span, placeholder));
                }
                PlexToken::LexToken(token) => {
                    return Some(spanned(span, token));
                }
                PlexToken::IdentStart => {
                    let head = delta.chars().next().unwrap();
                    return Some(self.scan_identifier(head, span));
                }
                _ => continue,
            }
        }
        None
    }
fn bump_token ( & mut self ) -> Option < SpannedToken > { while let Some ( ( token , delta ) ) = self . lookahead ( ) { let span = self . shift_location ( delta ) ; match token { PlexToken :: EOF => { self . receive_eof ( ) ; break ; } PlexToken :: Error ( placeholder , plex_err ) => { let err = plex_err . into_lexer_error ( span ) ; self . errors . push ( err ) ; return Some ( spanned ( span , placeholder ) ) ; } PlexToken :: LexToken ( token ) => { return Some ( spanned ( span , token ) ) ; } PlexToken :: IdentStart => { let head = delta . chars ( ) . next ( ) . unwrap ( ) ; return Some ( self . scan_identifier ( head , span ) ) ; } _ => continue , } } None }
Produces the next token in the source input.
Produces the next token in the source input .
&mut self