Lines Matching refs:syn
3 //! 1. Parse the file using syn into a syn::File.
4 //! 2. Extract every syn::Expr from the file.
7 //! 5. For both the syn::Expr and rustc_ast::Expr, crawl the syntax tree to
9 //! 6. Serialize the fully parenthesized syn::Expr to a string of source code.
12 //! data structures vs syn data structures, ignoring spans. If they agree,
13 //! rustc's parser and syn's parser have identical handling of expression
76 let (l_passed, l_failed) = match syn::parse_file(&content) {
90 errorf!("\nFAIL {} - syn failed to parse: {}\n", path.display(), msg);
114 fn test_expressions(path: &Path, edition: Edition, exprs: Vec<syn::Expr>) -> (usize, usize) {
159 let Ok(reparsed_expr_invisible) = syn::parse2(expr_invisible.to_token_stream()) else {
162 "\nFAIL {} - syn failed to parse invisible delimiters\n{}\n",
386 fn syn_parenthesize(syn_expr: syn::Expr) -> syn::Expr {
387 use syn::fold::{fold_expr, fold_generic_argument, Fold};
388 use syn::{token, BinOp, Expr, ExprParen, GenericArgument, MetaNameValue, Pat, Stmt, Type};
472 fn make_parens_invisible(expr: syn::Expr) -> syn::Expr {
473 use syn::fold::{fold_expr, fold_stmt, Fold};
474 use syn::{token, Expr, ExprGroup, ExprParen, Stmt};
511 fn collect_exprs(file: syn::File) -> Vec<syn::Expr> {
512 use syn::fold::Fold;
513 use syn::punctuated::Punctuated;
514 use syn::{token, ConstParam, Expr, ExprTuple, Pat, Path};