fn consume_neg_number(&mut self) -> TokenKind {
        match self.expect_advance() {
            Ok('0') => self.consume_zero_number(),
            Ok(ch) if is_dec_digit(ch) => self.consume_dec_literal(),
            Ok(ch) => {
                self.add_diagnostic(
                    Diagnostic::new_error(format!("unexpected character `{}`", ch))
                        .with_label(Label::new_primary(self.token_span())),
                );
                TokenKind::Error
            },
            Err(err) => {
                self.add_diagnostic(err);
                TokenKind::Error
            },
        }
    }
/// Consume a number starting with a negative sign.
Consume a number starting with a negative sign.
Consume a number starting with a negative sign .
fn consume_neg_number(&mut self) -> TokenKind {
        match self.expect_advance() {
            Ok('0') => self.consume_zero_number(),
            Ok(ch) if is_dec_digit(ch) => self.consume_dec_literal(),
            Ok(ch) => {
                self.add_diagnostic(
                    Diagnostic::new_error(format!("unexpected character `{}`", ch))
                        .with_label(Label::new_primary(self.token_span())),
                );
                TokenKind::Error
            },
            Err(err) => {
                self.add_diagnostic(err);
                TokenKind::Error
            },
        }
    }
fn consume_neg_number ( & mut self ) -> TokenKind { match self . expect_advance ( ) { Ok ( '0' ) => self . consume_zero_number ( ) , Ok ( ch ) if is_dec_digit ( ch ) => self . consume_dec_literal ( ) , Ok ( ch ) => { self . add_diagnostic ( Diagnostic :: new_error ( format ! ( " " ch ) ) . with_label ( Label :: new_primary ( self . token_span ( ) ) ) , ) ; TokenKind :: Error } , Err ( err ) => { self . add_diagnostic ( err ) ; TokenKind :: Error } , } }
Consume a number starting with a negative sign.
Consume a number starting with a negative sign .
&mut self
&mut self