/// Aggregate documentation comments into one big token.
///
/// This is used to facilitate future parsing of the documentation.
Aggregate documentation comments into one big token.
This is used to facilitate future parsing of the documentation.
Aggregate documentation comments into one big token . This is used to facilitate future parsing of the documentation .
fn agg_doc_comments(&mut self, first: SpannedToken) -> SpannedToken {
        let start = first.span.start();
        let mut end = first.span.end();
        let mut docs = match first.into_inner() {
            Token::DocComment(doc) => vec![doc],
            _ => panic!("agg_doc_comment called with non-documentation token"),
        };
        while let Some(tok) = self.peek_token() {
            match tok {
                PlexToken::LexToken(Token::DocComment(doc)) => {
                    let has_leading_space = doc.starts_with(' ');
                    docs.push(doc.to_owned());
                    let next = self.bump_token().unwrap();
                    end = next.span.end();
                   if !has_leading_space {
                        let warn = LexerError::MissingLeadingWhitespace { start: next.span };
                        self.warnings.push(warn)
                    }
                }
                PlexToken::Whitespace => self.ignore_token(),
                _ => break,
            }
        }
        let full_doc_token = Token::DocComment(docs.join(""));
        spanned2(start, end, full_doc_token)
    }
fn agg_doc_comments ( & mut self , first : SpannedToken ) -> SpannedToken { let start = first . span . start ( ) ; let mut end = first . span . end ( ) ; let mut docs = match first . into_inner ( ) { Token :: DocComment ( doc ) => vec ! [ doc ] , _ => panic ! ( " " ) , } ; while let Some ( tok ) = self . peek_token ( ) { match tok { PlexToken :: LexToken ( Token :: DocComment ( doc ) ) => { let has_leading_space = doc . starts_with ( ' ' ) ; docs . push ( doc . to_owned ( ) ) ; let next = self . bump_token ( ) . unwrap ( ) ; end = next . span . end ( ) ; if ! has_leading_space { let warn = LexerError :: MissingLeadingWhitespace { start : next . span } ; self . warnings . push ( warn ) } } PlexToken :: Whitespace => self . ignore_token ( ) , _ => break , } } let full_doc_token = Token :: DocComment ( docs . join ( " " ) ) ; spanned2 ( start , end , full_doc_token ) }
Aggregate documentation comments into one big token.
Aggregate documentation comments into one big token .
&mut self
first
SpannedToken