fn parse_item_foreign_mod(&mut self,
                              lo: BytePos,
                              opt_abi: Option<abi::Abi>,
                              visibility: Visibility,
                              mut attrs: Vec<Attribute>)
                              -> PResult<'a, P<Item>> {
        try!(self.expect(&token::OpenDelim(token::Brace)));

        let abi = opt_abi.unwrap_or(Abi::C);

        attrs.extend(try!(self.parse_inner_attributes()));

        let mut foreign_items = vec![];
        while let Some(item) = try!(self.parse_foreign_item()) {
            foreign_items.push(item);
        }
        try!(self.expect(&token::CloseDelim(token::Brace)));

        let last_span = self.last_span;
        let m = ast::ForeignMod {
            abi: abi,
            items: foreign_items
        };
        Ok(self.mk_item(lo,
                     last_span.hi,
                     special_idents::invalid,
                     ItemKind::ForeignMod(m),
                     visibility,
                     attrs))
    }
/// Parse `extern` for foreign ABIs
/// modules.
///
/// `extern` is expected to have been
/// consumed before calling this method
///
/// # Examples:
///
/// extern "C" {}
/// extern {}
Parse `extern` for foreign ABIs
modules.

`extern` is expected to have been
consumed before calling this method
Parse ` extern ` for foreign ABIs modules . ` extern ` is expected to have been consumed before calling this method
fn parse_item_foreign_mod(&mut self,
                              lo: BytePos,
                              opt_abi: Option<abi::Abi>,
                              visibility: Visibility,
                              mut attrs: Vec<Attribute>)
                              -> PResult<'a, P<Item>> {
        try!(self.expect(&token::OpenDelim(token::Brace)));
        let abi = opt_abi.unwrap_or(Abi::C);
        attrs.extend(try!(self.parse_inner_attributes()));
        let mut foreign_items = vec![];
        while let Some(item) = try!(self.parse_foreign_item()) {
            foreign_items.push(item);
        }
        try!(self.expect(&token::CloseDelim(token::Brace)));
        let last_span = self.last_span;
        let m = ast::ForeignMod {
            abi: abi,
            items: foreign_items
        };
        Ok(self.mk_item(lo,
                     last_span.hi,
                     special_idents::invalid,
                     ItemKind::ForeignMod(m),
                     visibility,
                     attrs))
    }
fn parse_item_foreign_mod ( & mut self , lo : BytePos , opt_abi : Option < abi :: Abi > , visibility : Visibility , mut attrs : Vec < Attribute > ) -> PResult < ' a , P < Item > > { try ! ( self expect ( token OpenDelim ( token Brace ) ) ) ; let abi = opt_abi . unwrap_or ( Abi :: C ) ; attrs . extend ( try ! ( self parse_inner_attributes ( ) ) ) ; let mut foreign_items = vec ! [ ] ; while let Some ( item ) = try ! ( self parse_foreign_item ( ) ) { foreign_items . push ( item ) ; } try ! ( self expect ( token CloseDelim ( token Brace ) ) ) ; let last_span = self . last_span ; let m = ast :: ForeignMod { abi : abi , items : foreign_items } ; Ok ( self . mk_item ( lo , last_span . hi , special_idents :: invalid , ItemKind :: ForeignMod ( m ) , visibility , attrs ) ) }
Parse `extern` for foreign ABIs
modules.
Parse ` extern ` for foreign ABIs modules .
&mut self
lo
BytePos
opt_abi
Option<abi::Abi>
visibility
Visibility
attrs
Vec<Attribute>
&mut self
lo
BytePos
opt_abi
Option<abi::Abi>
visibility
Visibility
attrs
Vec<Attribute>
examples:
extern "C" {}
extern {}
extern " C " {} extern {}