fn consume_normal(&mut self) -> Result<(), LexicalError> {
        // Check if we have some character:
        if let Some(c) = self.chr0 {
            // First check identifier:
            if self.is_identifier_start(c) {
                let identifier = self.lex_identifier()?;
                self.emit(identifier);
            } else if is_emoji_presentation(c) {
                let tok_start = self.get_pos();
                self.next_char();
                let tok_end = self.get_pos();
                self.emit((
                    tok_start,
                    Tok::Name {
                        name: c.to_string(),
                    },
                    tok_end,
                ));
            } else {
                self.consume_character(c)?;
            }
        } else {
            // We reached end of file.
            let tok_pos = self.get_pos();

            // First of all, we need all nestings to be finished.
            if self.nesting > 0 {
                return Err(LexicalError {
                    error: LexicalErrorType::NestingError,
                    location: tok_pos,
                });
            }

            // Next, insert a trailing newline, if required.
            if !self.at_begin_of_line {
                self.at_begin_of_line = true;
                self.emit((tok_pos, Tok::Newline, tok_pos));
            }

            // Next, flush the indentation stack to zero.
            while self.indentation_stack.len() > 1 {
                self.indentation_stack.pop();
                self.emit((tok_pos, Tok::Dedent, tok_pos));
            }

            self.emit((tok_pos, Tok::EndOfFile, tok_pos));
        }

        Ok(())
    }
/// Take a look at the next character, if any, and decide upon the next steps.
Take a look at the next character, if any, and decide upon the next steps.
Take a look at the next character if any and decide upon the next steps .
fn consume_normal(&mut self) -> Result<(), LexicalError> {
        // Check if we have some character:
        if let Some(c) = self.chr0 {
            // First check identifier:
            if self.is_identifier_start(c) {
                let identifier = self.lex_identifier()?;
                self.emit(identifier);
            } else if is_emoji_presentation(c) {
                let tok_start = self.get_pos();
                self.next_char();
                let tok_end = self.get_pos();
                self.emit((
                    tok_start,
                    Tok::Name {
                        name: c.to_string(),
                    },
                    tok_end,
                ));
            } else {
                self.consume_character(c)?;
            }
        } else {
            // We reached end of file.
            let tok_pos = self.get_pos();
            // First of all, we need all nestings to be finished.
            if self.nesting > 0 {
                return Err(LexicalError {
                    error: LexicalErrorType::NestingError,
                    location: tok_pos,
                });
            }
            // Next, insert a trailing newline, if required.
            if !self.at_begin_of_line {
                self.at_begin_of_line = true;
                self.emit((tok_pos, Tok::Newline, tok_pos));
            }
            // Next, flush the indentation stack to zero.
            while self.indentation_stack.len() > 1 {
                self.indentation_stack.pop();
                self.emit((tok_pos, Tok::Dedent, tok_pos));
            }
            self.emit((tok_pos, Tok::EndOfFile, tok_pos));
        }
        Ok(())
    }
fn consume_normal ( & mut self ) -> Result < ( ) , LexicalError > { // Check if we have some character: if let Some ( c ) = self . chr0 { // First check identifier: if self . is_identifier_start ( c ) { let identifier = self . lex_identifier ( ) ? ; self . emit ( identifier ) ; } else if is_emoji_presentation ( c ) { let tok_start = self . get_pos ( ) ; self . next_char ( ) ; let tok_end = self . get_pos ( ) ; self . emit ( ( tok_start , Tok :: Name { name : c . to_string ( ) , } , tok_end , ) ) ; } else { self . consume_character ( c ) ? ; } } else { // We reached end of file. let tok_pos = self . get_pos ( ) ; // First of all, we need all nestings to be finished. if self . nesting > 0 { return Err ( LexicalError { error : LexicalErrorType :: NestingError , location : tok_pos , } ) ; } // Next, insert a trailing newline, if required. if ! self . at_begin_of_line { self . at_begin_of_line = true ; self . emit ( ( tok_pos , Tok :: Newline , tok_pos ) ) ; } // Next, flush the indentation stack to zero. while self . indentation_stack . len ( ) > 1 { self . indentation_stack . pop ( ) ; self . emit ( ( tok_pos , Tok :: Dedent , tok_pos ) ) ; } self . emit ( ( tok_pos , Tok :: EndOfFile , tok_pos ) ) ; } Ok ( ( ) ) }
Take a look at the next character, if any, and decide upon the next steps.
Take a look at the next character if any and decide upon the next steps .
&mut self