/// Parse an based integer, i.e. a sequence of letters and digits with
/// optional intermittent underscores '_'.
Parse an based integer, i.e. a sequence of letters and digits with
optional intermittent underscores '_'.
Parse an based integer i . e . a sequence of letters and digits with optional intermittent underscores ' _ ' .
fn parse_based_integer(&mut self) -> Spanned<Name> {
        let (mut s, mut sp) = match self.inner.next() {
            Some(Spanned {
                value: Bundle::Letters(n),
                span,
            })
            | Some(Spanned {
                value: Bundle::Digits(n),
                span,
            }) => (n, span),
            Some(n) => {
                let sp = n.span.begin().into();
                self.emit(DiagBuilder2::error("Expected digits or letters").span(sp));
                self.inner.undo(Some(n));
                return Spanned::new(get_name_table().intern("", true), sp);
            }
            None => {
                self.emit(DiagBuilder2::error("Expected digits or letters"));
                self.inner.undo(None);
                return Spanned::new(get_name_table().intern("", true), INVALID_SPAN);
            }
        };
        loop {
            match self.inner.next() {
                Some(Spanned {
                    value: Bundle::Letters(n),
                    span,
                })
                | Some(Spanned {
                    value: Bundle::Digits(n),
                    span,
                }) => {
                    s.push_str(&n);
                    sp.end = span.end;
                }
                Some(Spanned {
                    value: Bundle::Special('_'),
                    ..
                }) => (),
                n => {
                    self.inner.undo(n);
                    break;
                }
            }
        }
        Spanned::new(get_name_table().intern(&s, true), sp)
    }
fn parse_based_integer ( & mut self ) -> Spanned < Name > { let ( mut s , mut sp ) = match self . inner . next ( ) { Some ( Spanned { value : Bundle :: Letters ( n ) , span , } ) | Some ( Spanned { value : Bundle :: Digits ( n ) , span , } ) => ( n , span ) , Some ( n ) => { let sp = n . span . begin ( ) . into ( ) ; self . emit ( DiagBuilder2 :: error ( " " ) . span ( sp ) ) ; self . inner . undo ( Some ( n ) ) ; return Spanned :: new ( get_name_table ( ) . intern ( " " , true ) , sp ) ; } None => { self . emit ( DiagBuilder2 :: error ( " " ) ) ; self . inner . undo ( None ) ; return Spanned :: new ( get_name_table ( ) . intern ( " " , true ) , INVALID_SPAN ) ; } } ; loop { match self . inner . next ( ) { Some ( Spanned { value : Bundle :: Letters ( n ) , span , } ) | Some ( Spanned { value : Bundle :: Digits ( n ) , span , } ) => { s . push_str ( & n ) ; sp . end = span . end ; } Some ( Spanned { value : Bundle :: Special ( '_' ) , .. } ) => ( ) , n => { self . inner . undo ( n ) ; break ; } } } Spanned :: new ( get_name_table ( ) . intern ( & s , true ) , sp ) }
Parse an based integer, i.e.
Parse an based integer i . e .
&mut self