fn parse_func_decl(&mut self) -> PResult<ast::FuncDecl> {
        trace!("parse_func_decl");
        // Grammar:
        // FunctionDecl = "func" FunctionName ( Function | Signature ) .
        // FunctionName = identifier .
        // Function     = Signature FunctionBody .
        // FunctionBody = Block .

        try!(self.eat(TokenKind::Func));
        let name = try_span!(self, self.parse_ident());
        let signature = try!(self.parse_func_signature());

        let body = match self.token.kind {
            // This function has a body, parse it.
            TokenKind::LBrace => Some(try!(self.parse_block())),
            // No body.
            _ => None,
        };
        try!(self.eat(TokenKind::Semicolon));

        Ok(ast::FuncDecl {
            name: name,
            signature: signature,
            body: body,
        })
    }
/// Parse a full function declaration (including signature, name, and block).
Parse a full function declaration (including signature, name, and block).
Parse a full function declaration ( including signature name and block ) .
fn parse_func_decl(&mut self) -> PResult<ast::FuncDecl> {
        trace!("parse_func_decl");
        // Grammar:
        // FunctionDecl = "func" FunctionName ( Function | Signature ) .
        // FunctionName = identifier .
        // Function     = Signature FunctionBody .
        // FunctionBody = Block .
        try!(self.eat(TokenKind::Func));
        let name = try_span!(self, self.parse_ident());
        let signature = try!(self.parse_func_signature());
        let body = match self.token.kind {
            // This function has a body, parse it.
            TokenKind::LBrace => Some(try!(self.parse_block())),
            // No body.
            _ => None,
        };
        try!(self.eat(TokenKind::Semicolon));
        Ok(ast::FuncDecl {
            name: name,
            signature: signature,
            body: body,
        })
    }
fn parse_func_decl ( & mut self ) -> PResult < ast :: FuncDecl > { trace ! ( " " ) ; // Grammar: // FunctionDecl = "func" FunctionName ( Function | Signature ) . // FunctionName = identifier . // Function     = Signature FunctionBody . // FunctionBody = Block . try ! ( self eat ( TokenKind Func ) ) ; let name = try_span ! ( self self parse_ident ( ) ) ; let signature = try ! ( self parse_func_signature ( ) ) ; let body = match self . token . kind { // This function has a body, parse it. TokenKind :: LBrace => Some ( try ! ( self parse_block ( ) ) ) , // No body. _ => None , } ; try ! ( self eat ( TokenKind Semicolon ) ) ; Ok ( ast :: FuncDecl { name : name , signature : signature , body : body , } ) }
Parse a full function declaration (including signature, name, and block).
Parse a full function declaration ( including signature name and block ) .
&mut self