fn parse_func_params(&mut self) -> PResult<ast::Parameters> {
        trace!("parse_func_params");
        // Grammar:
        //
        // Parameters     = "(" [ ParameterList [ "," ] ] ")" .
        // ParameterList  = ParameterDecl { "," ParameterDecl } .
        // ParameterDecl  = [ IdentifierList ] [ "..." ] Type .
        try!(self.eat(TokenKind::LParen));

        let mut decls = Vec::new();

        // The parameter list is optional.
        match self.token.kind {
            TokenKind::Ident | TokenKind::Ellipsis => {
                decls.push(try!(self.parse_parameter_decl()));

                while let TokenKind::Comma = self.token.kind {
                    try!(self.eat(TokenKind::Comma));
                    decls.push(try!(self.parse_parameter_decl()));
                }
            }
            _ => {}
        }
        try!(self.eat(TokenKind::RParen));

        // XXX: do we _need_ Parameters to be a type by itself?
        Ok(ast::Parameters { decls: decls })
    }
/// Parse function parameters, as defined by the Go grammar.
///
/// This may be used to parse the return types of a function if they are prefixed with a
/// parenthesis, and follow the same grammar as input parameters.
/// Parameters may be named or unnamed.
Parse function parameters, as defined by the Go grammar.
This may be used to parse the return types of a function if they are prefixed with a
parenthesis, and follow the same grammar as input parameters.
Parameters may be named or unnamed.
Parse function parameters as defined by the Go grammar . This may be used to parse the return types of a function if they are prefixed with a parenthesis and follow the same grammar as input parameters . Parameters may be named or unnamed .
fn parse_func_params(&mut self) -> PResult<ast::Parameters> {
        trace!("parse_func_params");
        // Grammar:
        //
        // Parameters     = "(" [ ParameterList [ "," ] ] ")" .
        // ParameterList  = ParameterDecl { "," ParameterDecl } .
        // ParameterDecl  = [ IdentifierList ] [ "..." ] Type .
        try!(self.eat(TokenKind::LParen));
        let mut decls = Vec::new();
        // The parameter list is optional.
        match self.token.kind {
            TokenKind::Ident | TokenKind::Ellipsis => {
                decls.push(try!(self.parse_parameter_decl()));
                while let TokenKind::Comma = self.token.kind {
                    try!(self.eat(TokenKind::Comma));
                    decls.push(try!(self.parse_parameter_decl()));
                }
            }
            _ => {}
        }
        try!(self.eat(TokenKind::RParen));
        // XXX: do we _need_ Parameters to be a type by itself?
        Ok(ast::Parameters { decls: decls })
    }
fn parse_func_params ( & mut self ) -> PResult < ast :: Parameters > { trace ! ( " " ) ; // Grammar: // // Parameters     = "(" [ ParameterList [ "," ] ] ")" . // ParameterList  = ParameterDecl { "," ParameterDecl } . // ParameterDecl  = [ IdentifierList ] [ "..." ] Type . try ! ( self eat ( TokenKind LParen ) ) ; let mut decls = Vec :: new ( ) ; // The parameter list is optional. match self . token . kind { TokenKind :: Ident | TokenKind :: Ellipsis => { decls . push ( try ! ( self parse_parameter_decl ( ) ) ) ; while let TokenKind :: Comma = self . token . kind { try ! ( self eat ( TokenKind Comma ) ) ; decls . push ( try ! ( self parse_parameter_decl ( ) ) ) ; } } _ => { } } try ! ( self eat ( TokenKind RParen ) ) ; // XXX: do we _need_ Parameters to be a type by itself? Ok ( ast :: Parameters { decls : decls } ) }
Parse function parameters, as defined by the Go grammar.
Parse function parameters as defined by the Go grammar .
&mut self