fn parse_unary_expr(&mut self) -> PResult<ast::UnaryExpr> {
        // UnaryExpr  = PrimaryExpr | unary_op UnaryExpr .
        trace!("parse_unary_expr");

        match self.token.kind {
            // kind: unary operator
            TokenKind::Plus | TokenKind::Minus | TokenKind::Not | TokenKind::Caret |
            TokenKind::And => {
                let op = ast::UnaryOperator::from_token_kind(self.token.kind).expect("BUG");
                self.bump();
                let x = try_span!(self, self.parse_unary_expr());
                Ok(ast::UnaryExpr::UnaryOperation(ast::UnaryOperation {
                    operator: op,
                    operand: Box::new(x),
                }))
            }
            // channel receive operation
            TokenKind::Arrow => {
                self.bump();
                let x = try_span!(self, self.parse_unary_expr());
                Ok(ast::UnaryExpr::UnaryOperation(ast::UnaryOperation {
                    operator: ast::UnaryOperator::ChanReceive,
                    operand: Box::new(x),
                }))
            }

            // deref expression - star op
            TokenKind::Star => {
                self.bump();
                let x = try_span!(self, self.parse_unary_expr());
                Ok(ast::UnaryExpr::UnaryOperation(ast::UnaryOperation {
                    operator: ast::UnaryOperator::Deref,
                    operand: Box::new(x),
                }))
            }
            // No operator, this can only be a primary expression.
            _ => {
                let x = try!(self.parse_primary_expr());
                Ok(ast::UnaryExpr::Primary(Box::new(x)))
            }
        }
    }
/// Parse a unary *expression*, which can be a primary expression OR a unary *operation*.
// XXX: too much repetition, could probably be shortened
Parse a unary *expression*, which can be a primary expression OR a unary *operation*.
XXX: too much repetition, could probably be shortened
Parse a unary * expression * which can be a primary expression OR a unary * operation * . XXX : too much repetition could probably be shortened
fn parse_unary_expr(&mut self) -> PResult<ast::UnaryExpr> {
        // UnaryExpr  = PrimaryExpr | unary_op UnaryExpr .
        trace!("parse_unary_expr");
        match self.token.kind {
            // kind: unary operator
            TokenKind::Plus | TokenKind::Minus | TokenKind::Not | TokenKind::Caret |
            TokenKind::And => {
                let op = ast::UnaryOperator::from_token_kind(self.token.kind).expect("BUG");
                self.bump();
                let x = try_span!(self, self.parse_unary_expr());
                Ok(ast::UnaryExpr::UnaryOperation(ast::UnaryOperation {
                    operator: op,
                    operand: Box::new(x),
                }))
            }
            // channel receive operation
            TokenKind::Arrow => {
                self.bump();
                let x = try_span!(self, self.parse_unary_expr());
                Ok(ast::UnaryExpr::UnaryOperation(ast::UnaryOperation {
                    operator: ast::UnaryOperator::ChanReceive,
                    operand: Box::new(x),
                }))
            }
            // deref expression - star op
            TokenKind::Star => {
                self.bump();
                let x = try_span!(self, self.parse_unary_expr());
                Ok(ast::UnaryExpr::UnaryOperation(ast::UnaryOperation {
                    operator: ast::UnaryOperator::Deref,
                    operand: Box::new(x),
                }))
            }
            // No operator, this can only be a primary expression.
            _ => {
                let x = try!(self.parse_primary_expr());
                Ok(ast::UnaryExpr::Primary(Box::new(x)))
            }
        }
    }
fn parse_unary_expr ( & mut self ) -> PResult < ast :: UnaryExpr > { // UnaryExpr  = PrimaryExpr | unary_op UnaryExpr . trace ! ( " " ) ; match self . token . kind { // kind: unary operator TokenKind :: Plus | TokenKind :: Minus | TokenKind :: Not | TokenKind :: Caret | TokenKind :: And => { let op = ast :: UnaryOperator :: from_token_kind ( self . token . kind ) . expect ( " " ) ; self . bump ( ) ; let x = try_span ! ( self self parse_unary_expr ( ) ) ; Ok ( ast :: UnaryExpr :: UnaryOperation ( ast :: UnaryOperation { operator : op , operand : Box :: new ( x ) , } ) ) } // channel receive operation TokenKind :: Arrow => { self . bump ( ) ; let x = try_span ! ( self self parse_unary_expr ( ) ) ; Ok ( ast :: UnaryExpr :: UnaryOperation ( ast :: UnaryOperation { operator : ast :: UnaryOperator :: ChanReceive , operand : Box :: new ( x ) , } ) ) } // deref expression - star op TokenKind :: Star => { self . bump ( ) ; let x = try_span ! ( self self parse_unary_expr ( ) ) ; Ok ( ast :: UnaryExpr :: UnaryOperation ( ast :: UnaryOperation { operator : ast :: UnaryOperator :: Deref , operand : Box :: new ( x ) , } ) ) } // No operator, this can only be a primary expression. _ => { let x = try ! ( self parse_primary_expr ( ) ) ; Ok ( ast :: UnaryExpr :: Primary ( Box :: new ( x ) ) ) } } }
Parse a unary *expression*, which can be a primary expression OR a unary *operation*.
Parse a unary * expression * which can be a primary expression OR a unary * operation * .
&mut self