fn parse_struct_info(&mut self) -> Result<StructInfo, ()> {
        let public = self.p.eat_keyword(token::keywords::Pub);
        let mut info = StructInfo {
            name: self.p.parse_ident(),
            public: public,
            deriving: vec![],
        };
        if self.p.eat(&token::Comma) { return Ok(info); }
        let deriving = self.p.parse_ident();
        if deriving.as_str() != "derive" {
            let err = format!("Expected 'derive' keyword but got '{}'",
                              deriving);
            self.cx.span_err(self.cx.call_site(), err.as_slice());
            return Err(());
        }
        while !self.p.eat(&token::Comma) {
            info.deriving.push(self.p.parse_ident().as_str().to_string());
        }
        Ok(info)
    }
/// Parses struct information, like visibility, name and deriving.
Parses struct information, like visibility, name and deriving.
Parses struct information like visibility name and deriving .
fn parse_struct_info(&mut self) -> Result<StructInfo, ()> {
        let public = self.p.eat_keyword(token::keywords::Pub);
        let mut info = StructInfo {
            name: self.p.parse_ident(),
            public: public,
            deriving: vec![],
        };
        if self.p.eat(&token::Comma) { return Ok(info); }
        let deriving = self.p.parse_ident();
        if deriving.as_str() != "derive" {
            let err = format!("Expected 'derive' keyword but got '{}'",
                              deriving);
            self.cx.span_err(self.cx.call_site(), err.as_slice());
            return Err(());
        }
        while !self.p.eat(&token::Comma) {
            info.deriving.push(self.p.parse_ident().as_str().to_string());
        }
        Ok(info)
    }
fn parse_struct_info ( & mut self ) -> Result < StructInfo , ( ) > { let public = self . p . eat_keyword ( token :: keywords :: Pub ) ; let mut info = StructInfo { name : self . p . parse_ident ( ) , public : public , deriving : vec ! [ ] , } ; if self . p . eat ( & token :: Comma ) { return Ok ( info ) ; } let deriving = self . p . parse_ident ( ) ; if deriving . as_str ( ) != " " { let err = format ! ( " " deriving ) ; self . cx . span_err ( self . cx . call_site ( ) , err . as_slice ( ) ) ; return Err ( ( ) ) ; } while ! self . p . eat ( & token :: Comma ) { info . deriving . push ( self . p . parse_ident ( ) . as_str ( ) . to_string ( ) ) ; } Ok ( info ) }
Parses struct information, like visibility, name and deriving.
Parses struct information like visibility name and deriving .
&mut self
&mut self