pub fn sub_exprs(&self) -> Vec<&Spanned<Expr<'src>>> {
        use self::ExprKind::*;

        match self.kind() {
            Error(_) => panic!(),
            NullLit | SizeOf(_) | DecLit(_) | FloatLit(_) | StringLit(_) | Ident(_) | Char(_) => {
                vec![]
            }
            New(expr) | Negate(_, expr) | BoolNegate(_, expr) | Deref(_, expr) | Ref(_, expr) => {
                vec![expr]
            }
            Binary(l, _, r) => vec![l, r],
            BoolBinary(l, _, r) => vec![l, r],
            Cast(e, _, _) => vec![e],
            Assign { left, value, .. } => vec![left, value],
            Call { args, callee, .. } => {
                if let ExprKind::Ident(_) = callee.node.kind() {
                    args.0.iter().collect()
                } else {
                    let mut vec = Vec::with_capacity(args.0.len() + 1);

                    vec.push(callee.as_ref());
                    for a in &args.0 {
                        vec.push(a);
                    }

                    vec
                }
            }
            Access { left, .. } => vec![left],
            StructInit { fields, .. } => fields.0.iter().map(|(_, e)| e).collect(),
        }
    }
/// Gets the sub expressions of this expression
Gets the sub expressions of this expression
Gets the sub expressions of this expression
pub fn sub_exprs(&self) -> Vec<&Spanned<Expr<'src>>> {
        use self::ExprKind::*;
        match self.kind() {
            Error(_) => panic!(),
            NullLit | SizeOf(_) | DecLit(_) | FloatLit(_) | StringLit(_) | Ident(_) | Char(_) => {
                vec![]
            }
            New(expr) | Negate(_, expr) | BoolNegate(_, expr) | Deref(_, expr) | Ref(_, expr) => {
                vec![expr]
            }
            Binary(l, _, r) => vec![l, r],
            BoolBinary(l, _, r) => vec![l, r],
            Cast(e, _, _) => vec![e],
            Assign { left, value, .. } => vec![left, value],
            Call { args, callee, .. } => {
                if let ExprKind::Ident(_) = callee.node.kind() {
                    args.0.iter().collect()
                } else {
                    let mut vec = Vec::with_capacity(args.0.len() + 1);
                    vec.push(callee.as_ref());
                    for a in &args.0 {
                        vec.push(a);
                    }
                    vec
                }
            }
            Access { left, .. } => vec![left],
            StructInit { fields, .. } => fields.0.iter().map(|(_, e)| e).collect(),
        }
    }
pub fn sub_exprs ( & self ) -> Vec < & Spanned < Expr < ' src > > > { use self :: ExprKind :: * ; match self . kind ( ) { Error ( _ ) => panic ! ( ) , NullLit | SizeOf ( _ ) | DecLit ( _ ) | FloatLit ( _ ) | StringLit ( _ ) | Ident ( _ ) | Char ( _ ) => { vec ! [ ] } New ( expr ) | Negate ( _ , expr ) | BoolNegate ( _ , expr ) | Deref ( _ , expr ) | Ref ( _ , expr ) => { vec ! [ expr ] } Binary ( l , _ , r ) => vec ! [ l r ] , BoolBinary ( l , _ , r ) => vec ! [ l r ] , Cast ( e , _ , _ ) => vec ! [ e ] , Assign { left , value , .. } => vec ! [ left value ] , Call { args , callee , .. } => { if let ExprKind :: Ident ( _ ) = callee . node . kind ( ) { args . 0 . iter ( ) . collect ( ) } else { let mut vec = Vec :: with_capacity ( args . 0 . len ( ) + 1 ) ; vec . push ( callee . as_ref ( ) ) ; for a in & args . 0 { vec . push ( a ) ; } vec } } Access { left , .. } => vec ! [ left ] , StructInit { fields , .. } => fields . 0 . iter ( ) . map ( | ( _ , e ) | e ) . collect ( ) , } }
Gets the sub expressions of this expression
Gets the sub expressions of this expression
&self
&self