fn parse_kind(&mut self, expected: TokenKind) -> ParseResult<Token> {
        let start = self.index();
        let token = self.parse_token();
        if token.kind == expected {
            Ok(token)
        } else {
            let error = Diagnostic::error(
                SyntaxError::Expected(expected),
                Location::new(self.source_location, Span::new(start, self.end_index)),
            );
            self.record_error(error);
            Err(())
        }
    }
/// Parse the next token, succeeding if it has the expected kind and failing
/// otherwise.
Parse the next token, succeeding if it has the expected kind and failing
otherwise.
Parse the next token succeeding if it has the expected kind and failing otherwise .
fn parse_kind(&mut self, expected: TokenKind) -> ParseResult<Token> {
        let start = self.index();
        let token = self.parse_token();
        if token.kind == expected {
            Ok(token)
        } else {
            let error = Diagnostic::error(
                SyntaxError::Expected(expected),
                Location::new(self.source_location, Span::new(start, self.end_index)),
            );
            self.record_error(error);
            Err(())
        }
    }
fn parse_kind ( & mut self , expected : TokenKind ) -> ParseResult < Token > { let start = self . index ( ) ; let token = self . parse_token ( ) ; if token . kind == expected { Ok ( token ) } else { let error = Diagnostic :: error ( SyntaxError :: Expected ( expected ) , Location :: new ( self . source_location , Span :: new ( start , self . end_index ) ) , ) ; self . record_error ( error ) ; Err ( ( ) ) } }
Parse the next token, succeeding if it has the expected kind and failing
otherwise.
Parse the next token succeeding if it has the expected kind and failing otherwise .
&mut self
expected
TokenKind
&mut self
expected
TokenKind