fn collect_exprs(file: syn::File) -> Vec<syn::Expr> {
    use synom::delimited::Delimited;
    use syn::*;
    use syn::fold::*;

    struct CollectExprsFolder(Vec<Expr>);
    impl Folder for CollectExprsFolder {
        fn fold_expr(&mut self, expr: Expr) -> Expr {
            self.0.push(expr);

            Expr {
                node: ExprKind::Tup(ExprTup {
                    args: Delimited::new(),
                    paren_token: tokens::Paren::default(),
                    lone_comma: None
                }),
                attrs: vec![],
            }
        }
    }

    let mut folder = CollectExprsFolder(vec![]);
    folder.fold_file(file);
    folder.0
}
/// Walk through a crate collecting all expressions we can find in it.
Walk through a crate collecting all expressions we can find in it.
Walk through a crate collecting all expressions we can find in it .
fn collect_exprs(file: syn::File) -> Vec<syn::Expr> {
    use synom::delimited::Delimited;
    use syn::*;
    use syn::fold::*;
    struct CollectExprsFolder(Vec<Expr>);
    impl Folder for CollectExprsFolder {
        fn fold_expr(&mut self, expr: Expr) -> Expr {
            self.0.push(expr);
            Expr {
                node: ExprKind::Tup(ExprTup {
                    args: Delimited::new(),
                    paren_token: tokens::Paren::default(),
                    lone_comma: None
                }),
                attrs: vec![],
            }
        }
    }
    let mut folder = CollectExprsFolder(vec![]);
    folder.fold_file(file);
    folder.0
}
fn collect_exprs ( file : syn :: File ) -> Vec < syn :: Expr > { use synom :: delimited :: Delimited ; use syn :: * ; use syn :: fold :: * ; struct CollectExprsFolder ( Vec < Expr > ) ; impl Folder for CollectExprsFolder { fn fold_expr ( & mut self , expr : Expr ) -> Expr { self . 0 . push ( expr ) ; Expr { node : ExprKind :: Tup ( ExprTup { args : Delimited :: new ( ) , paren_token : tokens :: Paren :: default ( ) , lone_comma : None } ) , attrs : vec ! [ ] , } } } let mut folder = CollectExprsFolder ( vec ! [ ] ) ; folder . fold_file ( file ) ; folder . 0 }
Walk through a crate collecting all expressions we can find in it.
Walk through a crate collecting all expressions we can find in it .
file
syn::File
file
syn::File