aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-07-31 20:45:29 +0100
committerAleksey Kladov <[email protected]>2020-07-31 20:45:29 +0100
commit22d295ceaaee76dbd555cdeedc0ed7578e66279d (patch)
treeae48a497fbe6ef49c5b8a9a0431c778953c428a0 /crates/ra_syntax/src
parent215b9b9cccd66c9e9413e7581931371daa0c94e5 (diff)
Rename DotDotPat -> RestPat
Diffstat (limited to 'crates/ra_syntax/src')
-rw-r--r--crates/ra_syntax/src/ast/generated/nodes.rs22
-rw-r--r--crates/ra_syntax/src/ast/node_ext.rs8
2 files changed, 15 insertions, 15 deletions
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs
index 01aefb60d..6cb637b1d 100644
--- a/crates/ra_syntax/src/ast/generated/nodes.rs
+++ b/crates/ra_syntax/src/ast/generated/nodes.rs
@@ -1130,10 +1130,10 @@ impl BoxPat {
1130 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } 1130 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
1131} 1131}
1132#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1132#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1133pub struct DotDotPat { 1133pub struct RestPat {
1134 pub(crate) syntax: SyntaxNode, 1134 pub(crate) syntax: SyntaxNode,
1135} 1135}
1136impl DotDotPat { 1136impl RestPat {
1137 pub fn dotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![..]) } 1137 pub fn dotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![..]) }
1138} 1138}
1139#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1139#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -1336,7 +1336,7 @@ pub enum Stmt {
1336pub enum Pat { 1336pub enum Pat {
1337 IdentPat(IdentPat), 1337 IdentPat(IdentPat),
1338 BoxPat(BoxPat), 1338 BoxPat(BoxPat),
1339 DotDotPat(DotDotPat), 1339 RestPat(RestPat),
1340 LiteralPat(LiteralPat), 1340 LiteralPat(LiteralPat),
1341 MacroPat(MacroPat), 1341 MacroPat(MacroPat),
1342 OrPat(OrPat), 1342 OrPat(OrPat),
@@ -2577,8 +2577,8 @@ impl AstNode for BoxPat {
2577 } 2577 }
2578 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2578 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2579} 2579}
2580impl AstNode for DotDotPat { 2580impl AstNode for RestPat {
2581 fn can_cast(kind: SyntaxKind) -> bool { kind == DOT_DOT_PAT } 2581 fn can_cast(kind: SyntaxKind) -> bool { kind == REST_PAT }
2582 fn cast(syntax: SyntaxNode) -> Option<Self> { 2582 fn cast(syntax: SyntaxNode) -> Option<Self> {
2583 if Self::can_cast(syntax.kind()) { 2583 if Self::can_cast(syntax.kind()) {
2584 Some(Self { syntax }) 2584 Some(Self { syntax })
@@ -3141,8 +3141,8 @@ impl From<IdentPat> for Pat {
3141impl From<BoxPat> for Pat { 3141impl From<BoxPat> for Pat {
3142 fn from(node: BoxPat) -> Pat { Pat::BoxPat(node) } 3142 fn from(node: BoxPat) -> Pat { Pat::BoxPat(node) }
3143} 3143}
3144impl From<DotDotPat> for Pat { 3144impl From<RestPat> for Pat {
3145 fn from(node: DotDotPat) -> Pat { Pat::DotDotPat(node) } 3145 fn from(node: RestPat) -> Pat { Pat::RestPat(node) }
3146} 3146}
3147impl From<LiteralPat> for Pat { 3147impl From<LiteralPat> for Pat {
3148 fn from(node: LiteralPat) -> Pat { Pat::LiteralPat(node) } 3148 fn from(node: LiteralPat) -> Pat { Pat::LiteralPat(node) }
@@ -3183,7 +3183,7 @@ impl From<TupleStructPat> for Pat {
3183impl AstNode for Pat { 3183impl AstNode for Pat {
3184 fn can_cast(kind: SyntaxKind) -> bool { 3184 fn can_cast(kind: SyntaxKind) -> bool {
3185 match kind { 3185 match kind {
3186 IDENT_PAT | BOX_PAT | DOT_DOT_PAT | LITERAL_PAT | MACRO_PAT | OR_PAT | PAREN_PAT 3186 IDENT_PAT | BOX_PAT | REST_PAT | LITERAL_PAT | MACRO_PAT | OR_PAT | PAREN_PAT
3187 | PATH_PAT | WILDCARD_PAT | RANGE_PAT | RECORD_PAT | REF_PAT | SLICE_PAT 3187 | PATH_PAT | WILDCARD_PAT | RANGE_PAT | RECORD_PAT | REF_PAT | SLICE_PAT
3188 | TUPLE_PAT | TUPLE_STRUCT_PAT => true, 3188 | TUPLE_PAT | TUPLE_STRUCT_PAT => true,
3189 _ => false, 3189 _ => false,
@@ -3193,7 +3193,7 @@ impl AstNode for Pat {
3193 let res = match syntax.kind() { 3193 let res = match syntax.kind() {
3194 IDENT_PAT => Pat::IdentPat(IdentPat { syntax }), 3194 IDENT_PAT => Pat::IdentPat(IdentPat { syntax }),
3195 BOX_PAT => Pat::BoxPat(BoxPat { syntax }), 3195 BOX_PAT => Pat::BoxPat(BoxPat { syntax }),
3196 DOT_DOT_PAT => Pat::DotDotPat(DotDotPat { syntax }), 3196 REST_PAT => Pat::RestPat(RestPat { syntax }),
3197 LITERAL_PAT => Pat::LiteralPat(LiteralPat { syntax }), 3197 LITERAL_PAT => Pat::LiteralPat(LiteralPat { syntax }),
3198 MACRO_PAT => Pat::MacroPat(MacroPat { syntax }), 3198 MACRO_PAT => Pat::MacroPat(MacroPat { syntax }),
3199 OR_PAT => Pat::OrPat(OrPat { syntax }), 3199 OR_PAT => Pat::OrPat(OrPat { syntax }),
@@ -3214,7 +3214,7 @@ impl AstNode for Pat {
3214 match self { 3214 match self {
3215 Pat::IdentPat(it) => &it.syntax, 3215 Pat::IdentPat(it) => &it.syntax,
3216 Pat::BoxPat(it) => &it.syntax, 3216 Pat::BoxPat(it) => &it.syntax,
3217 Pat::DotDotPat(it) => &it.syntax, 3217 Pat::RestPat(it) => &it.syntax,
3218 Pat::LiteralPat(it) => &it.syntax, 3218 Pat::LiteralPat(it) => &it.syntax,
3219 Pat::MacroPat(it) => &it.syntax, 3219 Pat::MacroPat(it) => &it.syntax,
3220 Pat::OrPat(it) => &it.syntax, 3220 Pat::OrPat(it) => &it.syntax,
@@ -3990,7 +3990,7 @@ impl std::fmt::Display for BoxPat {
3990 std::fmt::Display::fmt(self.syntax(), f) 3990 std::fmt::Display::fmt(self.syntax(), f)
3991 } 3991 }
3992} 3992}
3993impl std::fmt::Display for DotDotPat { 3993impl std::fmt::Display for RestPat {
3994 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3994 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3995 std::fmt::Display::fmt(self.syntax(), f) 3995 std::fmt::Display::fmt(self.syntax(), f)
3996 } 3996 }
diff --git a/crates/ra_syntax/src/ast/node_ext.rs b/crates/ra_syntax/src/ast/node_ext.rs
index af5a93d1d..2ffb83819 100644
--- a/crates/ra_syntax/src/ast/node_ext.rs
+++ b/crates/ra_syntax/src/ast/node_ext.rs
@@ -293,15 +293,15 @@ impl ast::SlicePat {
293 let mut args = self.args().peekable(); 293 let mut args = self.args().peekable();
294 let prefix = args 294 let prefix = args
295 .peeking_take_while(|p| match p { 295 .peeking_take_while(|p| match p {
296 ast::Pat::DotDotPat(_) => false, 296 ast::Pat::RestPat(_) => false,
297 ast::Pat::IdentPat(bp) => match bp.pat() { 297 ast::Pat::IdentPat(bp) => match bp.pat() {
298 Some(ast::Pat::DotDotPat(_)) => false, 298 Some(ast::Pat::RestPat(_)) => false,
299 _ => true, 299 _ => true,
300 }, 300 },
301 ast::Pat::RefPat(rp) => match rp.pat() { 301 ast::Pat::RefPat(rp) => match rp.pat() {
302 Some(ast::Pat::DotDotPat(_)) => false, 302 Some(ast::Pat::RestPat(_)) => false,
303 Some(ast::Pat::IdentPat(bp)) => match bp.pat() { 303 Some(ast::Pat::IdentPat(bp)) => match bp.pat() {
304 Some(ast::Pat::DotDotPat(_)) => false, 304 Some(ast::Pat::RestPat(_)) => false,
305 _ => true, 305 _ => true,
306 }, 306 },
307 _ => true, 307 _ => true,