fn match_ident(&mut self) -> DiagResult2<(String, Span)> {
        let mut s = String::new();
        let mut sp = self.peek[0].1;
        loop {
            match self.peek[0] {
                (CatTokenKind::Text, this_sp)
                | (CatTokenKind::Digits, this_sp)
                | (CatTokenKind::Symbol('_'), this_sp)
                | (CatTokenKind::Symbol('$'), this_sp) => {
                    s.push_str(&this_sp.extract());
                    sp.expand(this_sp);
                    self.bump()?;
                }
                _ => break,
            }
        }
        if s.is_empty() {
            return Err(DiagBuilder2::fatal("Could not match an identifier here").span(sp));
        }
        assert!(!s.is_empty());
        Ok((s, sp))
    }
/// Matches an identifier. This consumes all tokens from the input that when
/// combined still make up a valid identifier and returns the consumed
/// characters as a String, alongside the span they covered. In
/// SystemVerilog upper- and lowercase characters, digits, underscores '_',
/// and dollar signs '$' are all valid within an identifier.
Matches an identifier. This consumes all tokens from the input that when
combined still make up a valid identifier and returns the consumed
characters as a String, alongside the span they covered. In
SystemVerilog upper- and lowercase characters, digits, underscores '_',
and dollar signs '$' are all valid within an identifier.
Matches an identifier . This consumes all tokens from the input that when combined still make up a valid identifier and returns the consumed characters as a String alongside the span they covered . In SystemVerilog upper - and lowercase characters digits underscores ' _ ' and dollar signs ' $ ' are all valid within an identifier .
fn match_ident(&mut self) -> DiagResult2<(String, Span)> {
        let mut s = String::new();
        let mut sp = self.peek[0].1;
        loop {
            match self.peek[0] {
                (CatTokenKind::Text, this_sp)
                | (CatTokenKind::Digits, this_sp)
                | (CatTokenKind::Symbol('_'), this_sp)
                | (CatTokenKind::Symbol('$'), this_sp) => {
                    s.push_str(&this_sp.extract());
                    sp.expand(this_sp);
                    self.bump()?;
                }
                _ => break,
            }
        }
        if s.is_empty() {
            return Err(DiagBuilder2::fatal("Could not match an identifier here").span(sp));
        }
        assert!(!s.is_empty());
        Ok((s, sp))
    }
fn match_ident ( & mut self ) -> DiagResult2 < ( String , Span ) > { let mut s = String :: new ( ) ; let mut sp = self . peek [ 0 ] . 1 ; loop { match self . peek [ 0 ] { ( CatTokenKind :: Text , this_sp ) | ( CatTokenKind :: Digits , this_sp ) | ( CatTokenKind :: Symbol ( '_' ) , this_sp ) | ( CatTokenKind :: Symbol ( '$' ) , this_sp ) => { s . push_str ( & this_sp . extract ( ) ) ; sp . expand ( this_sp ) ; self . bump ( ) ? ; } _ => break , } } if s . is_empty ( ) { return Err ( DiagBuilder2 :: fatal ( " " ) . span ( sp ) ) ; } assert ! ( s is_empty ( ) ) ; Ok ( ( s , sp ) ) }
Matches an identifier.
Matches an identifier .
&mut self
&mut self