From 6791eb9685375da94556bb910ea71f78b08be5ec Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 20:07:21 +0200 Subject: [PATCH] Rename PalceholderPat -> WildcardPat --- .../src/handlers/fill_match_arms.rs | 22 +++++++++---------- .../src/handlers/merge_match_arms.rs | 2 +- .../src/handlers/replace_let_with_if_let.rs | 3 +-- crates/ra_hir_def/src/body/lower.rs | 2 +- crates/ra_parser/src/grammar/patterns.rs | 2 +- crates/ra_parser/src/syntax_kind/generated.rs | 2 +- crates/ra_syntax/src/ast/edit.rs | 2 +- crates/ra_syntax/src/ast/generated/nodes.rs | 22 +++++++++---------- crates/ra_syntax/src/ast/make.rs | 4 ++-- .../parser/err/0024_many_type_parens.rast | 6 ++--- .../err/0032_match_arms_inner_attrs.rast | 12 +++++----- .../err/0033_match_arms_outer_attrs.rast | 4 ++-- .../err/0007_async_without_semicolon.rast | 2 +- .../inline/ok/0026_tuple_pat_fields.rast | 6 ++--- .../test_data/parser/inline/ok/0030_cond.rast | 14 ++++++------ .../parser/inline/ok/0042_call_expr.rast | 6 ++--- .../parser/inline/ok/0053_path_expr.rast | 8 +++---- .../inline/ok/0059_match_arms_commas.rast | 6 ++--- .../parser/inline/ok/0066_match_arm.rast | 4 ++-- .../ok/0070_stmt_bin_expr_ambiguity.rast | 2 +- .../parser/inline/ok/0071_match_expr.rast | 2 +- .../ok/0074_stmt_postfix_expr_ambiguity.rast | 2 +- .../parser/inline/ok/0075_block.rast | 2 +- .../parser/inline/ok/0080_postfix_range.rast | 4 ++-- .../parser/inline/ok/0082_ref_expr.rast | 12 +++++----- .../parser/inline/ok/0085_expr_literals.rast | 20 ++++++++--------- .../inline/ok/0095_placeholder_pat.rast | 2 +- .../inline/ok/0096_no_semi_after_block.rast | 2 +- .../inline/ok/0102_record_field_pat_list.rast | 4 ++-- .../parser/inline/ok/0112_bind_pat.rast | 4 ++-- .../parser/inline/ok/0118_match_guard.rast | 2 +- .../ok/0120_match_arms_inner_attribute.rast | 2 +- .../ok/0121_match_arms_outer_attributes.rast | 6 ++--- .../0122_generic_lifetime_type_attribute.rast | 2 +- .../parser/inline/ok/0130_let_stmt.rast | 2 +- .../parser/inline/ok/0130_try_block_expr.rast | 2 +- .../parser/inline/ok/0146_as_precedence.rast | 2 +- .../parser/inline/ok/0156_or_pattern.rast | 16 +++++++------- .../ok/0157_fn_pointer_unnamed_arg.rast | 2 +- .../parser/ok/0030_string_suffixes.rast | 8 +++---- .../test_data/parser/ok/0035_weird_exprs.rast | 6 ++--- .../parser/ok/0042_ufcs_call_list.rast | 2 +- .../ok/0047_minus_in_inner_pattern.rast | 6 ++--- .../parser/ok/0051_parameter_attrs.rast | 2 +- .../parser/ok/0054_qual_path_in_type_arg.rast | 4 ++-- .../parser/ok/0059_loops_in_parens.rast | 2 +- .../parser/ok/0063_trait_fn_patterns.rast | 2 +- .../parser/ok/0063_variadic_fun.rast | 8 +++---- xtask/src/ast_src.rs | 2 +- xtask/src/codegen/rust.ungram | 4 ++-- 50 files changed, 132 insertions(+), 135 deletions(-) diff --git a/crates/ra_assists/src/handlers/fill_match_arms.rs b/crates/ra_assists/src/handlers/fill_match_arms.rs index 708e1bc6ca..36658f1046 100644 --- a/crates/ra_assists/src/handlers/fill_match_arms.rs +++ b/crates/ra_assists/src/handlers/fill_match_arms.rs @@ -43,7 +43,7 @@ pub(crate) fn fill_match_arms(acc: &mut Assists, ctx: &AssistContext) -> Option< let mut arms: Vec = match_arm_list.arms().collect(); if arms.len() == 1 { - if let Some(Pat::PlaceholderPat(..)) = arms[0].pat() { + if let Some(Pat::WildcardPat(..)) = arms[0].pat() { arms.clear(); } } @@ -116,17 +116,15 @@ pub(crate) fn fill_match_arms(acc: &mut Assists, ctx: &AssistContext) -> Option< match (first_new_arm, ctx.config.snippet_cap) { (Some(first_new_arm), Some(cap)) => { let extend_lifetime; - let cursor = match first_new_arm - .syntax() - .descendants() - .find_map(ast::PlaceholderPat::cast) - { - Some(it) => { - extend_lifetime = it.syntax().clone(); - Cursor::Replace(&extend_lifetime) - } - None => Cursor::Before(first_new_arm.syntax()), - }; + let cursor = + match first_new_arm.syntax().descendants().find_map(ast::WildcardPat::cast) + { + Some(it) => { + extend_lifetime = it.syntax().clone(); + Cursor::Replace(&extend_lifetime) + } + None => Cursor::Before(first_new_arm.syntax()), + }; let snippet = render_snippet(cap, new_arm_list.syntax(), cursor); builder.replace_snippet(cap, old_range, snippet); } diff --git a/crates/ra_assists/src/handlers/merge_match_arms.rs b/crates/ra_assists/src/handlers/merge_match_arms.rs index 186a1f6183..5632922823 100644 --- a/crates/ra_assists/src/handlers/merge_match_arms.rs +++ b/crates/ra_assists/src/handlers/merge_match_arms.rs @@ -86,7 +86,7 @@ pub(crate) fn merge_match_arms(acc: &mut Assists, ctx: &AssistContext) -> Option } fn contains_placeholder(a: &ast::MatchArm) -> bool { - matches!(a.pat(), Some(ast::Pat::PlaceholderPat(..))) + matches!(a.pat(), Some(ast::Pat::WildcardPat(..))) } #[cfg(test)] diff --git a/crates/ra_assists/src/handlers/replace_let_with_if_let.rs b/crates/ra_assists/src/handlers/replace_let_with_if_let.rs index a49292c970..64ad15a230 100644 --- a/crates/ra_assists/src/handlers/replace_let_with_if_let.rs +++ b/crates/ra_assists/src/handlers/replace_let_with_if_let.rs @@ -62,8 +62,7 @@ pub(crate) fn replace_let_with_if_let(acc: &mut Assists, ctx: &AssistContext) -> let if_ = make::expr_if(make::condition(init, Some(with_placeholder)), block); let stmt = make::expr_stmt(if_); - let placeholder = - stmt.syntax().descendants().find_map(ast::PlaceholderPat::cast).unwrap(); + let placeholder = stmt.syntax().descendants().find_map(ast::WildcardPat::cast).unwrap(); let stmt = stmt.replace_descendant(placeholder.into(), original_pat); edit.replace_ast(ast::Stmt::from(let_stmt), ast::Stmt::from(stmt)); diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index ef1c0df014..7b988ae337 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs @@ -783,7 +783,7 @@ impl ExprCollector<'_> { let (args, ellipsis) = self.collect_tuple_pat(p.args()); Pat::Tuple { args, ellipsis } } - ast::Pat::PlaceholderPat(_) => Pat::Wild, + ast::Pat::WildcardPat(_) => Pat::Wild, ast::Pat::RecordPat(p) => { let path = p.path().and_then(|path| self.expander.parse_path(path)); let args: Vec<_> = p diff --git a/crates/ra_parser/src/grammar/patterns.rs b/crates/ra_parser/src/grammar/patterns.rs index d5dd9ffa2f..51e413cd66 100644 --- a/crates/ra_parser/src/grammar/patterns.rs +++ b/crates/ra_parser/src/grammar/patterns.rs @@ -234,7 +234,7 @@ fn placeholder_pat(p: &mut Parser) -> CompletedMarker { assert!(p.at(T![_])); let m = p.start(); p.bump(T![_]); - m.complete(p, PLACEHOLDER_PAT) + m.complete(p, WILDCARD_PAT) } // test dot_dot_pat diff --git a/crates/ra_parser/src/syntax_kind/generated.rs b/crates/ra_parser/src/syntax_kind/generated.rs index 9db328dc3d..c24611f4b2 100644 --- a/crates/ra_parser/src/syntax_kind/generated.rs +++ b/crates/ra_parser/src/syntax_kind/generated.rs @@ -157,7 +157,7 @@ pub enum SyntaxKind { REF_PAT, BOX_PAT, BIND_PAT, - PLACEHOLDER_PAT, + WILDCARD_PAT, DOT_DOT_PAT, PATH_PAT, RECORD_PAT, diff --git a/crates/ra_syntax/src/ast/edit.rs b/crates/ra_syntax/src/ast/edit.rs index 04746ef8f4..667a9294fb 100644 --- a/crates/ra_syntax/src/ast/edit.rs +++ b/crates/ra_syntax/src/ast/edit.rs @@ -390,7 +390,7 @@ impl ast::MatchArmList { #[must_use] pub fn remove_placeholder(&self) -> ast::MatchArmList { let placeholder = - self.arms().find(|arm| matches!(arm.pat(), Some(ast::Pat::PlaceholderPat(_)))); + self.arms().find(|arm| matches!(arm.pat(), Some(ast::Pat::WildcardPat(_)))); if let Some(placeholder) = placeholder { self.remove_arm(&placeholder) } else { diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index 713aebcfa1..f6b3fa6efe 100644 --- a/crates/ra_syntax/src/ast/generated/nodes.rs +++ b/crates/ra_syntax/src/ast/generated/nodes.rs @@ -1175,10 +1175,10 @@ impl PathPat { pub fn path(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct PlaceholderPat { +pub struct WildcardPat { pub(crate) syntax: SyntaxNode, } -impl PlaceholderPat { +impl WildcardPat { pub fn underscore_token(&self) -> Option { support::token(&self.syntax, T![_]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] @@ -1343,7 +1343,7 @@ pub enum Pat { OrPat(OrPat), ParenPat(ParenPat), PathPat(PathPat), - PlaceholderPat(PlaceholderPat), + WildcardPat(WildcardPat), RangePat(RangePat), RecordPat(RecordPat), RefPat(RefPat), @@ -2644,8 +2644,8 @@ impl AstNode for PathPat { } fn syntax(&self) -> &SyntaxNode { &self.syntax } } -impl AstNode for PlaceholderPat { - fn can_cast(kind: SyntaxKind) -> bool { kind == PLACEHOLDER_PAT } +impl AstNode for WildcardPat { + fn can_cast(kind: SyntaxKind) -> bool { kind == WILDCARD_PAT } fn cast(syntax: SyntaxNode) -> Option { if Self::can_cast(syntax.kind()) { Some(Self { syntax }) @@ -3160,8 +3160,8 @@ impl From for Pat { impl From for Pat { fn from(node: PathPat) -> Pat { Pat::PathPat(node) } } -impl From for Pat { - fn from(node: PlaceholderPat) -> Pat { Pat::PlaceholderPat(node) } +impl From for Pat { + fn from(node: WildcardPat) -> Pat { Pat::WildcardPat(node) } } impl From for Pat { fn from(node: RangePat) -> Pat { Pat::RangePat(node) } @@ -3185,7 +3185,7 @@ impl AstNode for Pat { fn can_cast(kind: SyntaxKind) -> bool { match kind { BIND_PAT | BOX_PAT | DOT_DOT_PAT | LITERAL_PAT | MACRO_PAT | OR_PAT | PAREN_PAT - | PATH_PAT | PLACEHOLDER_PAT | RANGE_PAT | RECORD_PAT | REF_PAT | SLICE_PAT + | PATH_PAT | WILDCARD_PAT | RANGE_PAT | RECORD_PAT | REF_PAT | SLICE_PAT | TUPLE_PAT | TUPLE_STRUCT_PAT => true, _ => false, } @@ -3200,7 +3200,7 @@ impl AstNode for Pat { OR_PAT => Pat::OrPat(OrPat { syntax }), PAREN_PAT => Pat::ParenPat(ParenPat { syntax }), PATH_PAT => Pat::PathPat(PathPat { syntax }), - PLACEHOLDER_PAT => Pat::PlaceholderPat(PlaceholderPat { syntax }), + WILDCARD_PAT => Pat::WildcardPat(WildcardPat { syntax }), RANGE_PAT => Pat::RangePat(RangePat { syntax }), RECORD_PAT => Pat::RecordPat(RecordPat { syntax }), REF_PAT => Pat::RefPat(RefPat { syntax }), @@ -3221,7 +3221,7 @@ impl AstNode for Pat { Pat::OrPat(it) => &it.syntax, Pat::ParenPat(it) => &it.syntax, Pat::PathPat(it) => &it.syntax, - Pat::PlaceholderPat(it) => &it.syntax, + Pat::WildcardPat(it) => &it.syntax, Pat::RangePat(it) => &it.syntax, Pat::RecordPat(it) => &it.syntax, Pat::RefPat(it) => &it.syntax, @@ -4021,7 +4021,7 @@ impl std::fmt::Display for PathPat { std::fmt::Display::fmt(self.syntax(), f) } } -impl std::fmt::Display for PlaceholderPat { +impl std::fmt::Display for WildcardPat { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { std::fmt::Display::fmt(self.syntax(), f) } diff --git a/crates/ra_syntax/src/ast/make.rs b/crates/ra_syntax/src/ast/make.rs index 3d4fed64ca..efb2cb4a38 100644 --- a/crates/ra_syntax/src/ast/make.rs +++ b/crates/ra_syntax/src/ast/make.rs @@ -156,10 +156,10 @@ pub fn bind_pat(name: ast::Name) -> ast::BindPat { } } -pub fn placeholder_pat() -> ast::PlaceholderPat { +pub fn placeholder_pat() -> ast::WildcardPat { return from_text("_"); - fn from_text(text: &str) -> ast::PlaceholderPat { + fn from_text(text: &str) -> ast::WildcardPat { ast_from_text(&format!("fn f({}: ())", text)) } } diff --git a/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.rast b/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.rast index 1cb1e97574..e3be6b22e1 100644 --- a/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.rast +++ b/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.rast @@ -80,7 +80,7 @@ SOURCE_FILE@0..240 LET_STMT@71..121 LET_KW@71..74 "let" WHITESPACE@74..75 " " - PLACEHOLDER_PAT@75..76 + WILDCARD_PAT@75..76 UNDERSCORE@75..76 "_" COLON@76..77 ":" WHITESPACE@77..78 " " @@ -147,7 +147,7 @@ SOURCE_FILE@0..240 LET_STMT@128..141 LET_KW@128..131 "let" WHITESPACE@131..132 " " - PLACEHOLDER_PAT@132..133 + WILDCARD_PAT@132..133 UNDERSCORE@132..133 "_" COLON@133..134 ":" WHITESPACE@134..135 " " @@ -223,7 +223,7 @@ SOURCE_FILE@0..240 LET_STMT@185..235 LET_KW@185..188 "let" WHITESPACE@188..189 " " - PLACEHOLDER_PAT@189..190 + WILDCARD_PAT@189..190 UNDERSCORE@189..190 "_" COLON@190..191 ":" WHITESPACE@191..192 " " diff --git a/crates/ra_syntax/test_data/parser/err/0032_match_arms_inner_attrs.rast b/crates/ra_syntax/test_data/parser/err/0032_match_arms_inner_attrs.rast index ec9f556aa5..672dd054ac 100644 --- a/crates/ra_syntax/test_data/parser/err/0032_match_arms_inner_attrs.rast +++ b/crates/ra_syntax/test_data/parser/err/0032_match_arms_inner_attrs.rast @@ -23,7 +23,7 @@ SOURCE_FILE@0..293 L_CURLY@24..25 "{" WHITESPACE@25..34 "\n " MATCH_ARM@34..41 - PLACEHOLDER_PAT@34..35 + WILDCARD_PAT@34..35 UNDERSCORE@34..35 "_" WHITESPACE@35..36 " " FAT_ARROW@36..38 "=>" @@ -54,7 +54,7 @@ SOURCE_FILE@0..293 R_BRACK@77..78 "]" WHITESPACE@78..87 "\n " MATCH_ARM@87..94 - PLACEHOLDER_PAT@87..88 + WILDCARD_PAT@87..88 UNDERSCORE@87..88 "_" WHITESPACE@88..89 " " FAT_ARROW@89..91 "=>" @@ -78,7 +78,7 @@ SOURCE_FILE@0..293 L_CURLY@116..117 "{" WHITESPACE@117..126 "\n " MATCH_ARM@126..133 - PLACEHOLDER_PAT@126..127 + WILDCARD_PAT@126..127 UNDERSCORE@126..127 "_" WHITESPACE@127..128 " " FAT_ARROW@128..130 "=>" @@ -89,7 +89,7 @@ SOURCE_FILE@0..293 COMMA@133..134 "," WHITESPACE@134..143 "\n " MATCH_ARM@143..150 - PLACEHOLDER_PAT@143..144 + WILDCARD_PAT@143..144 UNDERSCORE@143..144 "_" WHITESPACE@144..145 " " FAT_ARROW@145..147 "=>" @@ -165,7 +165,7 @@ SOURCE_FILE@0..293 R_BRACK@249..250 "]" WHITESPACE@250..259 "\n " MATCH_ARM@259..266 - PLACEHOLDER_PAT@259..260 + WILDCARD_PAT@259..260 UNDERSCORE@259..260 "_" WHITESPACE@260..261 " " FAT_ARROW@261..263 "=>" @@ -176,7 +176,7 @@ SOURCE_FILE@0..293 COMMA@266..267 "," WHITESPACE@267..276 "\n " MATCH_ARM@276..283 - PLACEHOLDER_PAT@276..277 + WILDCARD_PAT@276..277 UNDERSCORE@276..277 "_" WHITESPACE@277..278 " " FAT_ARROW@278..280 "=>" diff --git a/crates/ra_syntax/test_data/parser/err/0033_match_arms_outer_attrs.rast b/crates/ra_syntax/test_data/parser/err/0033_match_arms_outer_attrs.rast index 063532e02d..33bb085e91 100644 --- a/crates/ra_syntax/test_data/parser/err/0033_match_arms_outer_attrs.rast +++ b/crates/ra_syntax/test_data/parser/err/0033_match_arms_outer_attrs.rast @@ -22,7 +22,7 @@ SOURCE_FILE@0..89 L_CURLY@24..25 "{" WHITESPACE@25..34 "\n " MATCH_ARM@34..41 - PLACEHOLDER_PAT@34..35 + WILDCARD_PAT@34..35 UNDERSCORE@34..35 "_" WHITESPACE@35..36 " " FAT_ARROW@36..38 "=>" @@ -33,7 +33,7 @@ SOURCE_FILE@0..89 COMMA@41..42 "," WHITESPACE@42..51 "\n " MATCH_ARM@51..58 - PLACEHOLDER_PAT@51..52 + WILDCARD_PAT@51..52 UNDERSCORE@51..52 "_" WHITESPACE@52..53 " " FAT_ARROW@53..55 "=>" diff --git a/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.rast b/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.rast index 3f3a7f1b9d..2c9570678e 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.rast @@ -14,7 +14,7 @@ SOURCE_FILE@0..30 LET_STMT@11..27 LET_KW@11..14 "let" WHITESPACE@14..15 " " - PLACEHOLDER_PAT@15..16 + WILDCARD_PAT@15..16 UNDERSCORE@15..16 "_" WHITESPACE@16..17 " " EQ@17..18 "=" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.rast b/crates/ra_syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.rast index e5f5503471..45d17e800c 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.rast @@ -38,7 +38,7 @@ SOURCE_FILE@0..97 NAME_REF@37..38 IDENT@37..38 "S" L_PAREN@38..39 "(" - PLACEHOLDER_PAT@39..40 + WILDCARD_PAT@39..40 UNDERSCORE@39..40 "_" R_PAREN@40..41 ")" WHITESPACE@41..42 " " @@ -58,7 +58,7 @@ SOURCE_FILE@0..97 NAME_REF@56..57 IDENT@56..57 "S" L_PAREN@57..58 "(" - PLACEHOLDER_PAT@58..59 + WILDCARD_PAT@58..59 UNDERSCORE@58..59 "_" COMMA@59..60 "," R_PAREN@60..61 ")" @@ -79,7 +79,7 @@ SOURCE_FILE@0..97 NAME_REF@76..77 IDENT@76..77 "S" L_PAREN@77..78 "(" - PLACEHOLDER_PAT@78..79 + WILDCARD_PAT@78..79 UNDERSCORE@78..79 "_" COMMA@79..80 "," WHITESPACE@80..81 " " diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0030_cond.rast b/crates/ra_syntax/test_data/parser/inline/ok/0030_cond.rast index 381284dc5d..58a97d3ad8 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0030_cond.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0030_cond.rast @@ -23,7 +23,7 @@ SOURCE_FILE@0..197 NAME_REF@18..22 IDENT@18..22 "Some" L_PAREN@22..23 "(" - PLACEHOLDER_PAT@23..24 + WILDCARD_PAT@23..24 UNDERSCORE@23..24 "_" R_PAREN@24..25 ")" WHITESPACE@25..26 " " @@ -67,7 +67,7 @@ SOURCE_FILE@0..197 NAME_REF@60..64 IDENT@60..64 "Some" L_PAREN@64..65 "(" - PLACEHOLDER_PAT@65..66 + WILDCARD_PAT@65..66 UNDERSCORE@65..66 "_" R_PAREN@66..67 ")" WHITESPACE@67..68 " " @@ -79,7 +79,7 @@ SOURCE_FILE@0..197 NAME_REF@70..74 IDENT@70..74 "Some" L_PAREN@74..75 "(" - PLACEHOLDER_PAT@75..76 + WILDCARD_PAT@75..76 UNDERSCORE@75..76 "_" R_PAREN@76..77 ")" WHITESPACE@77..78 " " @@ -110,7 +110,7 @@ SOURCE_FILE@0..197 NAME_REF@101..105 IDENT@101..105 "Some" L_PAREN@105..106 "(" - PLACEHOLDER_PAT@106..107 + WILDCARD_PAT@106..107 UNDERSCORE@106..107 "_" R_PAREN@107..108 ")" WHITESPACE@108..109 " " @@ -140,7 +140,7 @@ SOURCE_FILE@0..197 NAME_REF@133..137 IDENT@133..137 "Some" L_PAREN@137..138 "(" - PLACEHOLDER_PAT@138..139 + WILDCARD_PAT@138..139 UNDERSCORE@138..139 "_" R_PAREN@139..140 ")" WHITESPACE@140..141 " " @@ -152,7 +152,7 @@ SOURCE_FILE@0..197 NAME_REF@143..147 IDENT@143..147 "Some" L_PAREN@147..148 "(" - PLACEHOLDER_PAT@148..149 + WILDCARD_PAT@148..149 UNDERSCORE@148..149 "_" R_PAREN@149..150 ")" WHITESPACE@150..151 " " @@ -182,7 +182,7 @@ SOURCE_FILE@0..197 NAME_REF@177..181 IDENT@177..181 "Some" L_PAREN@181..182 "(" - PLACEHOLDER_PAT@182..183 + WILDCARD_PAT@182..183 UNDERSCORE@182..183 "_" R_PAREN@183..184 ")" WHITESPACE@184..185 " " diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0042_call_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0042_call_expr.rast index 40875ae1e5..fa38e94667 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0042_call_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0042_call_expr.rast @@ -14,7 +14,7 @@ SOURCE_FILE@0..118 LET_STMT@15..27 LET_KW@15..18 "let" WHITESPACE@18..19 " " - PLACEHOLDER_PAT@19..20 + WILDCARD_PAT@19..20 UNDERSCORE@19..20 "_" WHITESPACE@20..21 " " EQ@21..22 "=" @@ -33,7 +33,7 @@ SOURCE_FILE@0..118 LET_STMT@32..54 LET_KW@32..35 "let" WHITESPACE@35..36 " " - PLACEHOLDER_PAT@36..37 + WILDCARD_PAT@36..37 UNDERSCORE@36..37 "_" WHITESPACE@37..38 " " EQ@38..39 "=" @@ -69,7 +69,7 @@ SOURCE_FILE@0..118 LET_STMT@59..84 LET_KW@59..62 "let" WHITESPACE@62..63 " " - PLACEHOLDER_PAT@63..64 + WILDCARD_PAT@63..64 UNDERSCORE@63..64 "_" WHITESPACE@64..65 " " EQ@65..66 "=" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.rast index de2016f188..c34cfeb315 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.rast @@ -14,7 +14,7 @@ SOURCE_FILE@0..91 LET_STMT@15..25 LET_KW@15..18 "let" WHITESPACE@18..19 " " - PLACEHOLDER_PAT@19..20 + WILDCARD_PAT@19..20 UNDERSCORE@19..20 "_" WHITESPACE@20..21 " " EQ@21..22 "=" @@ -29,7 +29,7 @@ SOURCE_FILE@0..91 LET_STMT@30..43 LET_KW@30..33 "let" WHITESPACE@33..34 " " - PLACEHOLDER_PAT@34..35 + WILDCARD_PAT@34..35 UNDERSCORE@34..35 "_" WHITESPACE@35..36 " " EQ@36..37 "=" @@ -49,7 +49,7 @@ SOURCE_FILE@0..91 LET_STMT@48..65 LET_KW@48..51 "let" WHITESPACE@51..52 " " - PLACEHOLDER_PAT@52..53 + WILDCARD_PAT@52..53 UNDERSCORE@52..53 "_" WHITESPACE@53..54 " " EQ@54..55 "=" @@ -75,7 +75,7 @@ SOURCE_FILE@0..91 LET_STMT@70..88 LET_KW@70..73 "let" WHITESPACE@73..74 " " - PLACEHOLDER_PAT@74..75 + WILDCARD_PAT@74..75 UNDERSCORE@74..75 "_" WHITESPACE@75..76 " " EQ@76..77 "=" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0059_match_arms_commas.rast b/crates/ra_syntax/test_data/parser/inline/ok/0059_match_arms_commas.rast index fa659c19bb..984829317e 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0059_match_arms_commas.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0059_match_arms_commas.rast @@ -22,7 +22,7 @@ SOURCE_FILE@0..83 L_CURLY@24..25 "{" WHITESPACE@25..34 "\n " MATCH_ARM@34..41 - PLACEHOLDER_PAT@34..35 + WILDCARD_PAT@34..35 UNDERSCORE@34..35 "_" WHITESPACE@35..36 " " FAT_ARROW@36..38 "=>" @@ -33,7 +33,7 @@ SOURCE_FILE@0..83 COMMA@41..42 "," WHITESPACE@42..51 "\n " MATCH_ARM@51..58 - PLACEHOLDER_PAT@51..52 + WILDCARD_PAT@51..52 UNDERSCORE@51..52 "_" WHITESPACE@52..53 " " FAT_ARROW@53..55 "=>" @@ -43,7 +43,7 @@ SOURCE_FILE@0..83 R_CURLY@57..58 "}" WHITESPACE@58..67 "\n " MATCH_ARM@67..74 - PLACEHOLDER_PAT@67..68 + WILDCARD_PAT@67..68 UNDERSCORE@67..68 "_" WHITESPACE@68..69 " " FAT_ARROW@69..71 "=>" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0066_match_arm.rast b/crates/ra_syntax/test_data/parser/inline/ok/0066_match_arm.rast index 37ca478e69..d873a7ecbe 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0066_match_arm.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0066_match_arm.rast @@ -23,7 +23,7 @@ SOURCE_FILE@0..167 L_CURLY@24..25 "{" WHITESPACE@25..34 "\n " MATCH_ARM@34..41 - PLACEHOLDER_PAT@34..35 + WILDCARD_PAT@34..35 UNDERSCORE@34..35 "_" WHITESPACE@35..36 " " FAT_ARROW@36..38 "=>" @@ -34,7 +34,7 @@ SOURCE_FILE@0..167 COMMA@41..42 "," WHITESPACE@42..51 "\n " MATCH_ARM@51..83 - PLACEHOLDER_PAT@51..52 + WILDCARD_PAT@51..52 UNDERSCORE@51..52 "_" WHITESPACE@52..53 " " MATCH_GUARD@53..77 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rast b/crates/ra_syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rast index 4c1165dc83..36c9cd5bb2 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rast @@ -14,7 +14,7 @@ SOURCE_FILE@0..46 LET_STMT@15..31 LET_KW@15..18 "let" WHITESPACE@18..19 " " - PLACEHOLDER_PAT@19..20 + WILDCARD_PAT@19..20 UNDERSCORE@19..20 "_" WHITESPACE@20..21 " " EQ@21..22 "=" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0071_match_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0071_match_expr.rast index 673d396eea..d34d98ced0 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0071_match_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0071_match_expr.rast @@ -53,7 +53,7 @@ SOURCE_FILE@0..97 L_CURLY@59..60 "{" WHITESPACE@60..61 " " MATCH_ARM@61..68 - PLACEHOLDER_PAT@61..62 + WILDCARD_PAT@61..62 UNDERSCORE@61..62 "_" WHITESPACE@62..63 " " FAT_ARROW@63..65 "=>" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rast b/crates/ra_syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rast index 3ca70f021b..3a789b9f51 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rast @@ -22,7 +22,7 @@ SOURCE_FILE@0..84 L_CURLY@24..25 "{" WHITESPACE@25..34 "\n " MATCH_ARM@34..41 - PLACEHOLDER_PAT@34..35 + WILDCARD_PAT@34..35 UNDERSCORE@34..35 "_" WHITESPACE@35..36 " " FAT_ARROW@36..38 "=>" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0075_block.rast b/crates/ra_syntax/test_data/parser/inline/ok/0075_block.rast index 5cefc50767..e847ce9b26 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0075_block.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0075_block.rast @@ -27,7 +27,7 @@ SOURCE_FILE@0..65 LET_STMT@19..29 LET_KW@19..22 "let" WHITESPACE@22..23 " " - PLACEHOLDER_PAT@23..24 + WILDCARD_PAT@23..24 UNDERSCORE@23..24 "_" WHITESPACE@24..25 " " EQ@25..26 "=" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.rast b/crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.rast index 3c80846db9..0c19d29c66 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.rast @@ -39,7 +39,7 @@ SOURCE_FILE@0..89 L_CURLY@42..43 "{" WHITESPACE@43..44 " " MATCH_ARM@44..51 - PLACEHOLDER_PAT@44..45 + WILDCARD_PAT@44..45 UNDERSCORE@44..45 "_" WHITESPACE@45..46 " " FAT_ARROW@46..48 "=>" @@ -79,7 +79,7 @@ SOURCE_FILE@0..89 L_CURLY@74..75 "{" WHITESPACE@75..76 " " MATCH_ARM@76..83 - PLACEHOLDER_PAT@76..77 + WILDCARD_PAT@76..77 UNDERSCORE@76..77 "_" WHITESPACE@77..78 " " FAT_ARROW@78..80 "=>" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.rast index 1563b1988b..70b975c0b1 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.rast @@ -16,7 +16,7 @@ SOURCE_FILE@0..200 LET_STMT@41..52 LET_KW@41..44 "let" WHITESPACE@44..45 " " - PLACEHOLDER_PAT@45..46 + WILDCARD_PAT@45..46 UNDERSCORE@45..46 "_" WHITESPACE@46..47 " " EQ@47..48 "=" @@ -30,7 +30,7 @@ SOURCE_FILE@0..200 LET_STMT@57..75 LET_KW@57..60 "let" WHITESPACE@60..61 " " - PLACEHOLDER_PAT@61..62 + WILDCARD_PAT@61..62 UNDERSCORE@61..62 "_" WHITESPACE@62..63 " " EQ@63..64 "=" @@ -55,7 +55,7 @@ SOURCE_FILE@0..200 LET_STMT@80..93 LET_KW@80..83 "let" WHITESPACE@83..84 " " - PLACEHOLDER_PAT@84..85 + WILDCARD_PAT@84..85 UNDERSCORE@84..85 "_" WHITESPACE@85..86 " " EQ@86..87 "=" @@ -72,7 +72,7 @@ SOURCE_FILE@0..200 LET_STMT@98..113 LET_KW@98..101 "let" WHITESPACE@101..102 " " - PLACEHOLDER_PAT@102..103 + WILDCARD_PAT@102..103 UNDERSCORE@102..103 "_" WHITESPACE@103..104 " " EQ@104..105 "=" @@ -95,7 +95,7 @@ SOURCE_FILE@0..200 LET_STMT@148..169 LET_KW@148..151 "let" WHITESPACE@151..152 " " - PLACEHOLDER_PAT@152..153 + WILDCARD_PAT@152..153 UNDERSCORE@152..153 "_" WHITESPACE@153..154 " " EQ@154..155 "=" @@ -116,7 +116,7 @@ SOURCE_FILE@0..200 LET_STMT@174..197 LET_KW@174..177 "let" WHITESPACE@177..178 " " - PLACEHOLDER_PAT@178..179 + WILDCARD_PAT@178..179 UNDERSCORE@178..179 "_" WHITESPACE@179..180 " " EQ@180..181 "=" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0085_expr_literals.rast b/crates/ra_syntax/test_data/parser/inline/ok/0085_expr_literals.rast index ded36949a0..9a87b5b936 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0085_expr_literals.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0085_expr_literals.rast @@ -14,7 +14,7 @@ SOURCE_FILE@0..189 LET_STMT@15..28 LET_KW@15..18 "let" WHITESPACE@18..19 " " - PLACEHOLDER_PAT@19..20 + WILDCARD_PAT@19..20 UNDERSCORE@19..20 "_" WHITESPACE@20..21 " " EQ@21..22 "=" @@ -26,7 +26,7 @@ SOURCE_FILE@0..189 LET_STMT@33..47 LET_KW@33..36 "let" WHITESPACE@36..37 " " - PLACEHOLDER_PAT@37..38 + WILDCARD_PAT@37..38 UNDERSCORE@37..38 "_" WHITESPACE@38..39 " " EQ@39..40 "=" @@ -38,7 +38,7 @@ SOURCE_FILE@0..189 LET_STMT@52..62 LET_KW@52..55 "let" WHITESPACE@55..56 " " - PLACEHOLDER_PAT@56..57 + WILDCARD_PAT@56..57 UNDERSCORE@56..57 "_" WHITESPACE@57..58 " " EQ@58..59 "=" @@ -50,7 +50,7 @@ SOURCE_FILE@0..189 LET_STMT@67..79 LET_KW@67..70 "let" WHITESPACE@70..71 " " - PLACEHOLDER_PAT@71..72 + WILDCARD_PAT@71..72 UNDERSCORE@71..72 "_" WHITESPACE@72..73 " " EQ@73..74 "=" @@ -62,7 +62,7 @@ SOURCE_FILE@0..189 LET_STMT@84..97 LET_KW@84..87 "let" WHITESPACE@87..88 " " - PLACEHOLDER_PAT@88..89 + WILDCARD_PAT@88..89 UNDERSCORE@88..89 "_" WHITESPACE@89..90 " " EQ@90..91 "=" @@ -74,7 +74,7 @@ SOURCE_FILE@0..189 LET_STMT@102..114 LET_KW@102..105 "let" WHITESPACE@105..106 " " - PLACEHOLDER_PAT@106..107 + WILDCARD_PAT@106..107 UNDERSCORE@106..107 "_" WHITESPACE@107..108 " " EQ@108..109 "=" @@ -86,7 +86,7 @@ SOURCE_FILE@0..189 LET_STMT@119..131 LET_KW@119..122 "let" WHITESPACE@122..123 " " - PLACEHOLDER_PAT@123..124 + WILDCARD_PAT@123..124 UNDERSCORE@123..124 "_" WHITESPACE@124..125 " " EQ@125..126 "=" @@ -98,7 +98,7 @@ SOURCE_FILE@0..189 LET_STMT@136..149 LET_KW@136..139 "let" WHITESPACE@139..140 " " - PLACEHOLDER_PAT@140..141 + WILDCARD_PAT@140..141 UNDERSCORE@140..141 "_" WHITESPACE@141..142 " " EQ@142..143 "=" @@ -110,7 +110,7 @@ SOURCE_FILE@0..189 LET_STMT@154..167 LET_KW@154..157 "let" WHITESPACE@157..158 " " - PLACEHOLDER_PAT@158..159 + WILDCARD_PAT@158..159 UNDERSCORE@158..159 "_" WHITESPACE@159..160 " " EQ@160..161 "=" @@ -122,7 +122,7 @@ SOURCE_FILE@0..189 LET_STMT@172..186 LET_KW@172..175 "let" WHITESPACE@175..176 " " - PLACEHOLDER_PAT@176..177 + WILDCARD_PAT@176..177 UNDERSCORE@176..177 "_" WHITESPACE@177..178 " " EQ@178..179 "=" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0095_placeholder_pat.rast b/crates/ra_syntax/test_data/parser/inline/ok/0095_placeholder_pat.rast index 25706d2a40..c1fdc6e259 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0095_placeholder_pat.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0095_placeholder_pat.rast @@ -14,7 +14,7 @@ SOURCE_FILE@0..26 LET_STMT@12..23 LET_KW@12..15 "let" WHITESPACE@15..16 " " - PLACEHOLDER_PAT@16..17 + WILDCARD_PAT@16..17 UNDERSCORE@16..17 "_" WHITESPACE@17..18 " " EQ@18..19 "=" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rast b/crates/ra_syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rast index cb5316a0dd..e757249f06 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rast @@ -59,7 +59,7 @@ SOURCE_FILE@0..167 FOR_EXPR@76..90 FOR_KW@76..79 "for" WHITESPACE@79..80 " " - PLACEHOLDER_PAT@80..81 + WILDCARD_PAT@80..81 UNDERSCORE@80..81 "_" WHITESPACE@81..82 " " IN_KW@82..84 "in" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0102_record_field_pat_list.rast b/crates/ra_syntax/test_data/parser/inline/ok/0102_record_field_pat_list.rast index 003c517acb..d0f70e9d78 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0102_record_field_pat_list.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0102_record_field_pat_list.rast @@ -84,7 +84,7 @@ SOURCE_FILE@0..119 IDENT@75..76 "h" COLON@76..77 ":" WHITESPACE@77..78 " " - PLACEHOLDER_PAT@78..79 + WILDCARD_PAT@78..79 UNDERSCORE@78..79 "_" COMMA@79..80 "," WHITESPACE@80..81 " " @@ -115,7 +115,7 @@ SOURCE_FILE@0..119 IDENT@103..104 "h" COLON@104..105 ":" WHITESPACE@105..106 " " - PLACEHOLDER_PAT@106..107 + WILDCARD_PAT@106..107 UNDERSCORE@106..107 "_" COMMA@107..108 "," WHITESPACE@108..109 " " diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0112_bind_pat.rast b/crates/ra_syntax/test_data/parser/inline/ok/0112_bind_pat.rast index 3cd554d459..65d5944c0e 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0112_bind_pat.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0112_bind_pat.rast @@ -84,7 +84,7 @@ SOURCE_FILE@0..146 WHITESPACE@101..102 " " AT@102..103 "@" WHITESPACE@103..104 " " - PLACEHOLDER_PAT@104..105 + WILDCARD_PAT@104..105 UNDERSCORE@104..105 "_" WHITESPACE@105..106 " " EQ@106..107 "=" @@ -113,7 +113,7 @@ SOURCE_FILE@0..146 WHITESPACE@133..134 " " AT@134..135 "@" WHITESPACE@135..136 " " - PLACEHOLDER_PAT@136..137 + WILDCARD_PAT@136..137 UNDERSCORE@136..137 "_" WHITESPACE@137..138 " " EQ@138..139 "=" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0118_match_guard.rast b/crates/ra_syntax/test_data/parser/inline/ok/0118_match_guard.rast index aaaf803b7c..0cf4eb0a5a 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0118_match_guard.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0118_match_guard.rast @@ -22,7 +22,7 @@ SOURCE_FILE@0..58 L_CURLY@24..25 "{" WHITESPACE@25..34 "\n " MATCH_ARM@34..48 - PLACEHOLDER_PAT@34..35 + WILDCARD_PAT@34..35 UNDERSCORE@34..35 "_" WHITESPACE@35..36 " " MATCH_GUARD@36..42 diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rast b/crates/ra_syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rast index 4b5f9cdc99..ec7a00f1db 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rast @@ -64,7 +64,7 @@ SOURCE_FILE@0..139 R_BRACK@112..113 "]" WHITESPACE@113..122 "\n " MATCH_ARM@122..129 - PLACEHOLDER_PAT@122..123 + WILDCARD_PAT@122..123 UNDERSCORE@122..123 "_" WHITESPACE@123..124 " " FAT_ARROW@124..126 "=>" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rast b/crates/ra_syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rast index 54cc3be3a0..97924da052 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rast @@ -39,7 +39,7 @@ SOURCE_FILE@0..259 R_PAREN@56..57 ")" R_BRACK@57..58 "]" WHITESPACE@58..67 "\n " - PLACEHOLDER_PAT@67..68 + WILDCARD_PAT@67..68 UNDERSCORE@67..68 "_" WHITESPACE@68..69 " " FAT_ARROW@69..71 "=>" @@ -67,7 +67,7 @@ SOURCE_FILE@0..259 R_PAREN@107..108 ")" R_BRACK@108..109 "]" WHITESPACE@109..118 "\n " - PLACEHOLDER_PAT@118..119 + WILDCARD_PAT@118..119 UNDERSCORE@118..119 "_" WHITESPACE@119..120 " " FAT_ARROW@120..122 "=>" @@ -129,7 +129,7 @@ SOURCE_FILE@0..259 R_PAREN@231..232 ")" R_BRACK@232..233 "]" WHITESPACE@233..242 "\n " - PLACEHOLDER_PAT@242..243 + WILDCARD_PAT@242..243 UNDERSCORE@242..243 "_" WHITESPACE@243..244 " " FAT_ARROW@244..246 "=>" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0122_generic_lifetime_type_attribute.rast b/crates/ra_syntax/test_data/parser/inline/ok/0122_generic_lifetime_type_attribute.rast index edac8d5d9e..8d029b5928 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0122_generic_lifetime_type_attribute.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0122_generic_lifetime_type_attribute.rast @@ -43,7 +43,7 @@ SOURCE_FILE@0..64 PARAM_LIST@49..59 L_PAREN@49..50 "(" PARAM@50..58 - PLACEHOLDER_PAT@50..51 + WILDCARD_PAT@50..51 UNDERSCORE@50..51 "_" COLON@51..52 ":" WHITESPACE@52..53 " " diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0130_let_stmt.rast b/crates/ra_syntax/test_data/parser/inline/ok/0130_let_stmt.rast index d2fd6e567a..16d616bd41 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0130_let_stmt.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0130_let_stmt.rast @@ -82,7 +82,7 @@ SOURCE_FILE@0..135 LET_STMT@93..107 LET_KW@93..96 "let" WHITESPACE@96..97 " " - PLACEHOLDER_PAT@97..98 + WILDCARD_PAT@97..98 UNDERSCORE@97..98 "_" COLON@98..99 ":" WHITESPACE@99..100 " " diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0130_try_block_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0130_try_block_expr.rast index 0fe3bf582a..ffdffe2f80 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0130_try_block_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0130_try_block_expr.rast @@ -14,7 +14,7 @@ SOURCE_FILE@0..33 LET_STMT@15..30 LET_KW@15..18 "let" WHITESPACE@18..19 " " - PLACEHOLDER_PAT@19..20 + WILDCARD_PAT@19..20 UNDERSCORE@19..20 "_" WHITESPACE@20..21 " " EQ@21..22 "=" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0146_as_precedence.rast b/crates/ra_syntax/test_data/parser/inline/ok/0146_as_precedence.rast index 2d0c834587..ca739825af 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0146_as_precedence.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0146_as_precedence.rast @@ -14,7 +14,7 @@ SOURCE_FILE@0..43 LET_STMT@15..40 LET_KW@15..18 "let" WHITESPACE@18..19 " " - PLACEHOLDER_PAT@19..20 + WILDCARD_PAT@19..20 UNDERSCORE@19..20 "_" WHITESPACE@20..21 " " EQ@21..22 "=" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0156_or_pattern.rast b/crates/ra_syntax/test_data/parser/inline/ok/0156_or_pattern.rast index 4d4c41f1a5..88a513cee2 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0156_or_pattern.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0156_or_pattern.rast @@ -25,12 +25,12 @@ SOURCE_FILE@0..130 PAREN_PAT@35..42 L_PAREN@35..36 "(" OR_PAT@36..41 - PLACEHOLDER_PAT@36..37 + WILDCARD_PAT@36..37 UNDERSCORE@36..37 "_" WHITESPACE@37..38 " " PIPE@38..39 "|" WHITESPACE@39..40 " " - PLACEHOLDER_PAT@40..41 + WILDCARD_PAT@40..41 UNDERSCORE@40..41 "_" R_PAREN@41..42 ")" WHITESPACE@42..43 " " @@ -47,12 +47,12 @@ SOURCE_FILE@0..130 PAREN_PAT@59..66 L_PAREN@59..60 "(" OR_PAT@60..65 - PLACEHOLDER_PAT@60..61 + WILDCARD_PAT@60..61 UNDERSCORE@60..61 "_" WHITESPACE@61..62 " " PIPE@62..63 "|" WHITESPACE@63..64 " " - PLACEHOLDER_PAT@64..65 + WILDCARD_PAT@64..65 UNDERSCORE@64..65 "_" R_PAREN@65..66 ")" WHITESPACE@66..67 " " @@ -67,12 +67,12 @@ SOURCE_FILE@0..130 TUPLE_PAT@82..90 L_PAREN@82..83 "(" OR_PAT@83..88 - PLACEHOLDER_PAT@83..84 + WILDCARD_PAT@83..84 UNDERSCORE@83..84 "_" WHITESPACE@84..85 " " PIPE@85..86 "|" WHITESPACE@86..87 " " - PLACEHOLDER_PAT@87..88 + WILDCARD_PAT@87..88 UNDERSCORE@87..88 "_" COMMA@88..89 "," R_PAREN@89..90 ")" @@ -88,12 +88,12 @@ SOURCE_FILE@0..130 SLICE_PAT@106..114 L_BRACK@106..107 "[" OR_PAT@107..112 - PLACEHOLDER_PAT@107..108 + WILDCARD_PAT@107..108 UNDERSCORE@107..108 "_" WHITESPACE@108..109 " " PIPE@109..110 "|" WHITESPACE@110..111 " " - PLACEHOLDER_PAT@111..112 + WILDCARD_PAT@111..112 UNDERSCORE@111..112 "_" COMMA@112..113 "," R_BRACK@113..114 "]" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0157_fn_pointer_unnamed_arg.rast b/crates/ra_syntax/test_data/parser/inline/ok/0157_fn_pointer_unnamed_arg.rast index ccca045b6b..3079e5bf83 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0157_fn_pointer_unnamed_arg.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0157_fn_pointer_unnamed_arg.rast @@ -12,7 +12,7 @@ SOURCE_FILE@0..23 PARAM_LIST@13..21 L_PAREN@13..14 "(" PARAM@14..20 - PLACEHOLDER_PAT@14..15 + WILDCARD_PAT@14..15 UNDERSCORE@14..15 "_" COLON@15..16 ":" WHITESPACE@16..17 " " diff --git a/crates/ra_syntax/test_data/parser/ok/0030_string_suffixes.rast b/crates/ra_syntax/test_data/parser/ok/0030_string_suffixes.rast index 93f7661490..80f7f5942c 100644 --- a/crates/ra_syntax/test_data/parser/ok/0030_string_suffixes.rast +++ b/crates/ra_syntax/test_data/parser/ok/0030_string_suffixes.rast @@ -14,7 +14,7 @@ SOURCE_FILE@0..112 LET_STMT@16..31 LET_KW@16..19 "let" WHITESPACE@19..20 " " - PLACEHOLDER_PAT@20..21 + WILDCARD_PAT@20..21 UNDERSCORE@20..21 "_" WHITESPACE@21..22 " " EQ@22..23 "=" @@ -26,7 +26,7 @@ SOURCE_FILE@0..112 LET_STMT@36..60 LET_KW@36..39 "let" WHITESPACE@39..40 " " - PLACEHOLDER_PAT@40..41 + WILDCARD_PAT@40..41 UNDERSCORE@40..41 "_" WHITESPACE@41..42 " " EQ@42..43 "=" @@ -38,7 +38,7 @@ SOURCE_FILE@0..112 LET_STMT@65..83 LET_KW@65..68 "let" WHITESPACE@68..69 " " - PLACEHOLDER_PAT@69..70 + WILDCARD_PAT@69..70 UNDERSCORE@69..70 "_" WHITESPACE@70..71 " " EQ@71..72 "=" @@ -50,7 +50,7 @@ SOURCE_FILE@0..112 LET_STMT@88..109 LET_KW@88..91 "let" WHITESPACE@91..92 " " - PLACEHOLDER_PAT@92..93 + WILDCARD_PAT@92..93 UNDERSCORE@92..93 "_" WHITESPACE@93..94 " " EQ@94..95 "=" diff --git a/crates/ra_syntax/test_data/parser/ok/0035_weird_exprs.rast b/crates/ra_syntax/test_data/parser/ok/0035_weird_exprs.rast index 0e0c8c9dc3..d48f638cd9 100644 --- a/crates/ra_syntax/test_data/parser/ok/0035_weird_exprs.rast +++ b/crates/ra_syntax/test_data/parser/ok/0035_weird_exprs.rast @@ -506,7 +506,7 @@ SOURCE_FILE@0..3813 R_CURLY@1146..1147 "}" WHITESPACE@1147..1168 "\n " MATCH_ARM@1168..1183 - PLACEHOLDER_PAT@1168..1169 + WILDCARD_PAT@1168..1169 UNDERSCORE@1168..1169 "_" WHITESPACE@1169..1170 " " FAT_ARROW@1170..1172 "=>" @@ -1102,7 +1102,7 @@ SOURCE_FILE@0..3813 COMMA@1863..1864 "," WHITESPACE@1864..1865 " " MATCH_ARM@1865..1883 - PLACEHOLDER_PAT@1865..1866 + WILDCARD_PAT@1865..1866 UNDERSCORE@1865..1866 "_" WHITESPACE@1866..1867 " " FAT_ARROW@1867..1869 "=>" @@ -1652,7 +1652,7 @@ SOURCE_FILE@0..3813 NAME@2963..2965 IDENT@2963..2965 "__" AT@2965..2966 "@" - PLACEHOLDER_PAT@2966..2967 + WILDCARD_PAT@2966..2967 UNDERSCORE@2966..2967 "_" PIPE@2967..2968 "|" PATH_EXPR@2968..2970 diff --git a/crates/ra_syntax/test_data/parser/ok/0042_ufcs_call_list.rast b/crates/ra_syntax/test_data/parser/ok/0042_ufcs_call_list.rast index ed29b0812c..e71e069f1f 100644 --- a/crates/ra_syntax/test_data/parser/ok/0042_ufcs_call_list.rast +++ b/crates/ra_syntax/test_data/parser/ok/0042_ufcs_call_list.rast @@ -63,7 +63,7 @@ SOURCE_FILE@0..199 PARAM_LIST@149..158 L_PAREN@149..150 "(" PARAM@150..157 - PLACEHOLDER_PAT@150..151 + WILDCARD_PAT@150..151 UNDERSCORE@150..151 "_" COLON@151..152 ":" WHITESPACE@152..153 " " diff --git a/crates/ra_syntax/test_data/parser/ok/0047_minus_in_inner_pattern.rast b/crates/ra_syntax/test_data/parser/ok/0047_minus_in_inner_pattern.rast index 7a54fa1132..4f8dff9094 100644 --- a/crates/ra_syntax/test_data/parser/ok/0047_minus_in_inner_pattern.rast +++ b/crates/ra_syntax/test_data/parser/ok/0047_minus_in_inner_pattern.rast @@ -55,7 +55,7 @@ SOURCE_FILE@0..395 COMMA@117..118 "," WHITESPACE@118..127 "\n " MATCH_ARM@127..134 - PLACEHOLDER_PAT@127..128 + WILDCARD_PAT@127..128 UNDERSCORE@127..128 "_" WHITESPACE@128..129 " " FAT_ARROW@129..131 "=>" @@ -127,7 +127,7 @@ SOURCE_FILE@0..395 COMMA@198..199 "," WHITESPACE@199..208 "\n " MATCH_ARM@208..215 - PLACEHOLDER_PAT@208..209 + WILDCARD_PAT@208..209 UNDERSCORE@208..209 "_" WHITESPACE@209..210 " " FAT_ARROW@210..212 "=>" @@ -203,7 +203,7 @@ SOURCE_FILE@0..395 COMMA@275..276 "," WHITESPACE@276..285 "\n " MATCH_ARM@285..292 - PLACEHOLDER_PAT@285..286 + WILDCARD_PAT@285..286 UNDERSCORE@285..286 "_" WHITESPACE@286..287 " " FAT_ARROW@287..289 "=>" diff --git a/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.rast b/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.rast index 706ccdc391..a80a6cd7a9 100644 --- a/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.rast +++ b/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.rast @@ -212,7 +212,7 @@ SOURCE_FILE@0..519 R_BRACK@203..204 "]" WHITESPACE@204..205 " " PARAM@205..211 - PLACEHOLDER_PAT@205..206 + WILDCARD_PAT@205..206 UNDERSCORE@205..206 "_" COLON@206..207 ":" WHITESPACE@207..208 " " diff --git a/crates/ra_syntax/test_data/parser/ok/0054_qual_path_in_type_arg.rast b/crates/ra_syntax/test_data/parser/ok/0054_qual_path_in_type_arg.rast index 0d48c7e81b..f71ceecd72 100644 --- a/crates/ra_syntax/test_data/parser/ok/0054_qual_path_in_type_arg.rast +++ b/crates/ra_syntax/test_data/parser/ok/0054_qual_path_in_type_arg.rast @@ -43,7 +43,7 @@ SOURCE_FILE@0..88 PARAM_LIST@32..53 L_PAREN@32..33 "(" PARAM@33..52 - PLACEHOLDER_PAT@33..34 + WILDCARD_PAT@33..34 UNDERSCORE@33..34 "_" COLON@34..35 ":" WHITESPACE@35..36 " " @@ -85,7 +85,7 @@ SOURCE_FILE@0..88 PARAM_LIST@62..84 L_PAREN@62..63 "(" PARAM@63..83 - PLACEHOLDER_PAT@63..64 + WILDCARD_PAT@63..64 UNDERSCORE@63..64 "_" COLON@64..65 ":" WHITESPACE@65..66 " " diff --git a/crates/ra_syntax/test_data/parser/ok/0059_loops_in_parens.rast b/crates/ra_syntax/test_data/parser/ok/0059_loops_in_parens.rast index 767b516a25..213f7b3815 100644 --- a/crates/ra_syntax/test_data/parser/ok/0059_loops_in_parens.rast +++ b/crates/ra_syntax/test_data/parser/ok/0059_loops_in_parens.rast @@ -23,7 +23,7 @@ SOURCE_FILE@0..105 FOR_EXPR@21..48 FOR_KW@21..24 "for" WHITESPACE@24..25 " " - PLACEHOLDER_PAT@25..26 + WILDCARD_PAT@25..26 UNDERSCORE@25..26 "_" WHITESPACE@26..27 " " IN_KW@27..29 "in" diff --git a/crates/ra_syntax/test_data/parser/ok/0063_trait_fn_patterns.rast b/crates/ra_syntax/test_data/parser/ok/0063_trait_fn_patterns.rast index 7c5467289a..9d88e4cbf4 100644 --- a/crates/ra_syntax/test_data/parser/ok/0063_trait_fn_patterns.rast +++ b/crates/ra_syntax/test_data/parser/ok/0063_trait_fn_patterns.rast @@ -163,7 +163,7 @@ SOURCE_FILE@0..170 PARAM_LIST@146..166 L_PAREN@146..147 "(" PARAM@147..153 - PLACEHOLDER_PAT@147..148 + WILDCARD_PAT@147..148 UNDERSCORE@147..148 "_" COLON@148..149 ":" WHITESPACE@149..150 " " diff --git a/crates/ra_syntax/test_data/parser/ok/0063_variadic_fun.rast b/crates/ra_syntax/test_data/parser/ok/0063_variadic_fun.rast index 7adedb02e3..d8bf1f8c8d 100644 --- a/crates/ra_syntax/test_data/parser/ok/0063_variadic_fun.rast +++ b/crates/ra_syntax/test_data/parser/ok/0063_variadic_fun.rast @@ -16,7 +16,7 @@ SOURCE_FILE@0..126 PARAM_LIST@21..39 L_PAREN@21..22 "(" PARAM@22..32 - PLACEHOLDER_PAT@22..23 + WILDCARD_PAT@22..23 UNDERSCORE@22..23 "_" COLON@23..24 ":" WHITESPACE@24..25 " " @@ -45,7 +45,7 @@ SOURCE_FILE@0..126 PARAM_LIST@49..69 L_PAREN@49..50 "(" PARAM@50..60 - PLACEHOLDER_PAT@50..51 + WILDCARD_PAT@50..51 UNDERSCORE@50..51 "_" COLON@51..52 ":" WHITESPACE@52..53 " " @@ -61,7 +61,7 @@ SOURCE_FILE@0..126 COMMA@60..61 "," WHITESPACE@61..62 " " PARAM@62..68 - PLACEHOLDER_PAT@62..63 + WILDCARD_PAT@62..63 UNDERSCORE@62..63 "_" COLON@63..64 ":" WHITESPACE@64..65 " " @@ -77,7 +77,7 @@ SOURCE_FILE@0..126 PARAM_LIST@79..122 L_PAREN@79..80 "(" PARAM@80..90 - PLACEHOLDER_PAT@80..81 + WILDCARD_PAT@80..81 UNDERSCORE@80..81 "_" COLON@81..82 ":" WHITESPACE@82..83 " " diff --git a/xtask/src/ast_src.rs b/xtask/src/ast_src.rs index 869bdaa0d2..fbe36d2f58 100644 --- a/xtask/src/ast_src.rs +++ b/xtask/src/ast_src.rs @@ -127,7 +127,7 @@ pub(crate) const KINDS_SRC: KindsSrc = KindsSrc { "REF_PAT", "BOX_PAT", "BIND_PAT", - "PLACEHOLDER_PAT", + "WILDCARD_PAT", "DOT_DOT_PAT", "PATH_PAT", "RECORD_PAT", diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram index cb8a307fe7..7c814240a6 100644 --- a/xtask/src/codegen/rust.ungram +++ b/xtask/src/codegen/rust.ungram @@ -505,7 +505,7 @@ Pat = | OrPat | ParenPat | PathPat -| PlaceholderPat +| WildcardPat | RangePat | RecordPat | RefPat @@ -519,7 +519,7 @@ LiteralPat = BindPat = Attr* 'ref'? 'mut'? Name ('@' Pat)? -PlaceholderPat = +WildcardPat = '_' RangePat =