pub(super) fn parse_outer_attributes(&mut self) -> PResult<'a, Vec<ast::Attribute>> {
        let mut attrs: Vec<ast::Attribute> = Vec::new();
        let mut just_parsed_doc_comment = false;
        loop {
            debug!("parse_outer_attributes: self.token={:?}", self.token);
            match self.token.kind {
                token::Pound => {
                    let inner_error_reason = if just_parsed_doc_comment {
                        "an inner attribute is not permitted following an outer doc comment"
                    } else if !attrs.is_empty() {
                        "an inner attribute is not permitted following an outer attribute"
                    } else {
                        DEFAULT_UNEXPECTED_INNER_ATTR_ERR_MSG
                    };
                    let inner_parse_policy =
                        InnerAttributeParsePolicy::NotPermitted {
                            reason: inner_error_reason,
                            saw_doc_comment: just_parsed_doc_comment,
                            prev_attr_sp: attrs.last().and_then(|a| Some(a.span))
                        };
                    let attr = self.parse_attribute_with_inner_parse_policy(inner_parse_policy)?;
                    attrs.push(attr);
                    just_parsed_doc_comment = false;
                }
                token::DocComment(s) => {
                    let attr = self.mk_doc_comment(s);
                    if attr.style != ast::AttrStyle::Outer {
                        let mut err = self.fatal("expected outer doc comment");
                        err.note("inner doc comments like this (starting with \
                                  `//!` or `/*!`) can only appear before items");
                        return Err(err);
                    }
                    attrs.push(attr);
                    self.bump();
                    just_parsed_doc_comment = true;
                }
                _ => break,
            }
        }
        Ok(attrs)
    }
/// Parses attributes that appear before an item.
Parses attributes that appear before an item.
Parses attributes that appear before an item .
pub(super) fn parse_outer_attributes(&mut self) -> PResult<'a, Vec<ast::Attribute>> {
        let mut attrs: Vec<ast::Attribute> = Vec::new();
        let mut just_parsed_doc_comment = false;
        loop {
            debug!("parse_outer_attributes: self.token={:?}", self.token);
            match self.token.kind {
                token::Pound => {
                    let inner_error_reason = if just_parsed_doc_comment {
                        "an inner attribute is not permitted following an outer doc comment"
                    } else if !attrs.is_empty() {
                        "an inner attribute is not permitted following an outer attribute"
                    } else {
                        DEFAULT_UNEXPECTED_INNER_ATTR_ERR_MSG
                    };
                    let inner_parse_policy =
                        InnerAttributeParsePolicy::NotPermitted {
                            reason: inner_error_reason,
                            saw_doc_comment: just_parsed_doc_comment,
                            prev_attr_sp: attrs.last().and_then(|a| Some(a.span))
                        };
                    let attr = self.parse_attribute_with_inner_parse_policy(inner_parse_policy)?;
                    attrs.push(attr);
                    just_parsed_doc_comment = false;
                }
                token::DocComment(s) => {
                    let attr = self.mk_doc_comment(s);
                    if attr.style != ast::AttrStyle::Outer {
                        let mut err = self.fatal("expected outer doc comment");
                        err.note("inner doc comments like this (starting with \
                                  `//!` or `/*!`) can only appear before items");
                        return Err(err);
                    }
                    attrs.push(attr);
                    self.bump();
                    just_parsed_doc_comment = true;
                }
                _ => break,
            }
        }
        Ok(attrs)
    }
pub ( super ) fn parse_outer_attributes ( & mut self ) -> PResult < ' a , Vec < ast :: Attribute > > { let mut attrs : Vec < ast :: Attribute > = Vec :: new ( ) ; let mut just_parsed_doc_comment = false ; loop { debug ! ( " " self token ) ; match self . token . kind { token :: Pound => { let inner_error_reason = if just_parsed_doc_comment { " " } else if ! attrs . is_empty ( ) { " " } else { DEFAULT_UNEXPECTED_INNER_ATTR_ERR_MSG } ; let inner_parse_policy = InnerAttributeParsePolicy :: NotPermitted { reason : inner_error_reason , saw_doc_comment : just_parsed_doc_comment , prev_attr_sp : attrs . last ( ) . and_then ( | a | Some ( a . span ) ) } ; let attr = self . parse_attribute_with_inner_parse_policy ( inner_parse_policy ) ? ; attrs . push ( attr ) ; just_parsed_doc_comment = false ; } token :: DocComment ( s ) => { let attr = self . mk_doc_comment ( s ) ; if attr . style != ast :: AttrStyle :: Outer { let mut err = self . fatal ( " " ) ; err . note ( " \
 " ) ; return Err ( err ) ; } attrs . push ( attr ) ; self . bump ( ) ; just_parsed_doc_comment = true ; } _ => break , } } Ok ( attrs ) }
Parses attributes that appear before an item.
Parses attributes that appear before an item .
&mut self