fn try_exponent(&mut self) -> Option<Spanned<Exponent>> {
        match self.inner.next() {
            Some(Spanned {
                value: Bundle::Letters(ref l),
                span: mut sp,
            }) if l == "e" || l == "E" => {
                let mut n = self.inner.next();
                let sign = match n {
                    Some(Spanned {
                        value: Bundle::Special('+'),
                        ..
                    }) => {
                        n = self.inner.next();
                        ExponentSign::Positive
                    }
                    Some(Spanned {
                        value: Bundle::Special('-'),
                        ..
                    }) => {
                        n = self.inner.next();
                        ExponentSign::Negative
                    }
                    _ => ExponentSign::Positive,
                };
                match n {
                    Some(Spanned {
                        value: Bundle::Digits(s),
                        span,
                    }) => {
                        let int = self.parse_integer(s, span);
                        sp.end = int.span.end;
                        Some(Spanned::new(Exponent(sign, int.value), sp))
                    }
                    n => {
                        self.emit(
                            DiagBuilder2::error(format!("Expected exponent after `{}`", l))
                                .span(sp),
                        );
                        self.inner.undo(n);
                        None
                    }
                }
            }
            n => {
                self.inner.undo(n);
                None
            }
        }
    }
/// Try to parse an exponent, introduced by a `E` character.
Try to parse an exponent, introduced by a `E` character.
Try to parse an exponent introduced by a ` E ` character .
fn try_exponent(&mut self) -> Option<Spanned<Exponent>> {
        match self.inner.next() {
            Some(Spanned {
                value: Bundle::Letters(ref l),
                span: mut sp,
            }) if l == "e" || l == "E" => {
                let mut n = self.inner.next();
                let sign = match n {
                    Some(Spanned {
                        value: Bundle::Special('+'),
                        ..
                    }) => {
                        n = self.inner.next();
                        ExponentSign::Positive
                    }
                    Some(Spanned {
                        value: Bundle::Special('-'),
                        ..
                    }) => {
                        n = self.inner.next();
                        ExponentSign::Negative
                    }
                    _ => ExponentSign::Positive,
                };
                match n {
                    Some(Spanned {
                        value: Bundle::Digits(s),
                        span,
                    }) => {
                        let int = self.parse_integer(s, span);
                        sp.end = int.span.end;
                        Some(Spanned::new(Exponent(sign, int.value), sp))
                    }
                    n => {
                        self.emit(
                            DiagBuilder2::error(format!("Expected exponent after `{}`", l))
                                .span(sp),
                        );
                        self.inner.undo(n);
                        None
                    }
                }
            }
            n => {
                self.inner.undo(n);
                None
            }
        }
    }
fn try_exponent ( & mut self ) -> Option < Spanned < Exponent > > { match self . inner . next ( ) { Some ( Spanned { value : Bundle :: Letters ( ref l ) , span : mut sp , } ) if l == " " || l == " " => { let mut n = self . inner . next ( ) ; let sign = match n { Some ( Spanned { value : Bundle :: Special ( '+' ) , .. } ) => { n = self . inner . next ( ) ; ExponentSign :: Positive } Some ( Spanned { value : Bundle :: Special ( '-' ) , .. } ) => { n = self . inner . next ( ) ; ExponentSign :: Negative } _ => ExponentSign :: Positive , } ; match n { Some ( Spanned { value : Bundle :: Digits ( s ) , span , } ) => { let int = self . parse_integer ( s , span ) ; sp . end = int . span . end ; Some ( Spanned :: new ( Exponent ( sign , int . value ) , sp ) ) } n => { self . emit ( DiagBuilder2 :: error ( format ! ( " " l ) ) . span ( sp ) , ) ; self . inner . undo ( n ) ; None } } } n => { self . inner . undo ( n ) ; None } } }
Try to parse an exponent, introduced by a `E` character.
Try to parse an exponent introduced by a ` E ` character .
&mut self
&mut self