diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-30 17:29:24 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-30 17:29:24 +0100 |
commit | 0f5805541be90a2789b0bc34c5d829042ac3b0ad (patch) | |
tree | 27effc491f45f7bd907cb0b24a5b0d907298d169 /crates/ra_syntax/src/ast/generated | |
parent | c8e2d67dd4462904f2803d64c651f4630ee595f4 (diff) | |
parent | c5798c4d75aa807aec47208a49101bdec3affcca (diff) |
Merge #5606
5606: Finalize impl Grammar r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/ast/generated')
-rw-r--r-- | crates/ra_syntax/src/ast/generated/nodes.rs | 63 |
1 files changed, 32 insertions, 31 deletions
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index 00a70fce0..ba00742f0 100644 --- a/crates/ra_syntax/src/ast/generated/nodes.rs +++ b/crates/ra_syntax/src/ast/generated/nodes.rs | |||
@@ -100,17 +100,18 @@ impl Fn { | |||
100 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } | 100 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
101 | } | 101 | } |
102 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 102 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
103 | pub struct ImplDef { | 103 | pub struct Impl { |
104 | pub(crate) syntax: SyntaxNode, | 104 | pub(crate) syntax: SyntaxNode, |
105 | } | 105 | } |
106 | impl ast::AttrsOwner for ImplDef {} | 106 | impl ast::AttrsOwner for Impl {} |
107 | impl ast::VisibilityOwner for ImplDef {} | 107 | impl ast::VisibilityOwner for Impl {} |
108 | impl ast::GenericParamsOwner for ImplDef {} | 108 | impl ast::GenericParamsOwner for Impl {} |
109 | impl ImplDef { | 109 | impl Impl { |
110 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } | ||
111 | pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } | 110 | pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } |
112 | pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } | 111 | pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } |
113 | pub fn impl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![impl]) } | 112 | pub fn impl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![impl]) } |
113 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } | ||
114 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | ||
114 | pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) } | 115 | pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) } |
115 | pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) } | 116 | pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) } |
116 | pub fn assoc_item_list(&self) -> Option<AssocItemList> { support::child(&self.syntax) } | 117 | pub fn assoc_item_list(&self) -> Option<AssocItemList> { support::child(&self.syntax) } |
@@ -169,15 +170,15 @@ impl Struct { | |||
169 | pub fn field_list(&self) -> Option<FieldList> { support::child(&self.syntax) } | 170 | pub fn field_list(&self) -> Option<FieldList> { support::child(&self.syntax) } |
170 | } | 171 | } |
171 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 172 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
172 | pub struct TraitDef { | 173 | pub struct Trait { |
173 | pub(crate) syntax: SyntaxNode, | 174 | pub(crate) syntax: SyntaxNode, |
174 | } | 175 | } |
175 | impl ast::AttrsOwner for TraitDef {} | 176 | impl ast::AttrsOwner for Trait {} |
176 | impl ast::NameOwner for TraitDef {} | 177 | impl ast::NameOwner for Trait {} |
177 | impl ast::VisibilityOwner for TraitDef {} | 178 | impl ast::VisibilityOwner for Trait {} |
178 | impl ast::GenericParamsOwner for TraitDef {} | 179 | impl ast::GenericParamsOwner for Trait {} |
179 | impl ast::TypeBoundsOwner for TraitDef {} | 180 | impl ast::TypeBoundsOwner for Trait {} |
180 | impl TraitDef { | 181 | impl Trait { |
181 | pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } | 182 | pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } |
182 | pub fn auto_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![auto]) } | 183 | pub fn auto_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![auto]) } |
183 | pub fn trait_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![trait]) } | 184 | pub fn trait_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![trait]) } |
@@ -1278,12 +1279,12 @@ pub enum Item { | |||
1278 | ExternBlock(ExternBlock), | 1279 | ExternBlock(ExternBlock), |
1279 | ExternCrate(ExternCrate), | 1280 | ExternCrate(ExternCrate), |
1280 | Fn(Fn), | 1281 | Fn(Fn), |
1281 | ImplDef(ImplDef), | 1282 | Impl(Impl), |
1282 | MacroCall(MacroCall), | 1283 | MacroCall(MacroCall), |
1283 | Module(Module), | 1284 | Module(Module), |
1284 | Static(Static), | 1285 | Static(Static), |
1285 | Struct(Struct), | 1286 | Struct(Struct), |
1286 | TraitDef(TraitDef), | 1287 | Trait(Trait), |
1287 | TypeAlias(TypeAlias), | 1288 | TypeAlias(TypeAlias), |
1288 | Union(Union), | 1289 | Union(Union), |
1289 | Use(Use), | 1290 | Use(Use), |
@@ -1477,8 +1478,8 @@ impl AstNode for Fn { | |||
1477 | } | 1478 | } |
1478 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1479 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1479 | } | 1480 | } |
1480 | impl AstNode for ImplDef { | 1481 | impl AstNode for Impl { |
1481 | fn can_cast(kind: SyntaxKind) -> bool { kind == IMPL_DEF } | 1482 | fn can_cast(kind: SyntaxKind) -> bool { kind == IMPL } |
1482 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1483 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1483 | if Self::can_cast(syntax.kind()) { | 1484 | if Self::can_cast(syntax.kind()) { |
1484 | Some(Self { syntax }) | 1485 | Some(Self { syntax }) |
@@ -1532,8 +1533,8 @@ impl AstNode for Struct { | |||
1532 | } | 1533 | } |
1533 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1534 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1534 | } | 1535 | } |
1535 | impl AstNode for TraitDef { | 1536 | impl AstNode for Trait { |
1536 | fn can_cast(kind: SyntaxKind) -> bool { kind == TRAIT_DEF } | 1537 | fn can_cast(kind: SyntaxKind) -> bool { kind == TRAIT } |
1537 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1538 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1538 | if Self::can_cast(syntax.kind()) { | 1539 | if Self::can_cast(syntax.kind()) { |
1539 | Some(Self { syntax }) | 1540 | Some(Self { syntax }) |
@@ -2790,8 +2791,8 @@ impl From<ExternCrate> for Item { | |||
2790 | impl From<Fn> for Item { | 2791 | impl From<Fn> for Item { |
2791 | fn from(node: Fn) -> Item { Item::Fn(node) } | 2792 | fn from(node: Fn) -> Item { Item::Fn(node) } |
2792 | } | 2793 | } |
2793 | impl From<ImplDef> for Item { | 2794 | impl From<Impl> for Item { |
2794 | fn from(node: ImplDef) -> Item { Item::ImplDef(node) } | 2795 | fn from(node: Impl) -> Item { Item::Impl(node) } |
2795 | } | 2796 | } |
2796 | impl From<MacroCall> for Item { | 2797 | impl From<MacroCall> for Item { |
2797 | fn from(node: MacroCall) -> Item { Item::MacroCall(node) } | 2798 | fn from(node: MacroCall) -> Item { Item::MacroCall(node) } |
@@ -2805,8 +2806,8 @@ impl From<Static> for Item { | |||
2805 | impl From<Struct> for Item { | 2806 | impl From<Struct> for Item { |
2806 | fn from(node: Struct) -> Item { Item::Struct(node) } | 2807 | fn from(node: Struct) -> Item { Item::Struct(node) } |
2807 | } | 2808 | } |
2808 | impl From<TraitDef> for Item { | 2809 | impl From<Trait> for Item { |
2809 | fn from(node: TraitDef) -> Item { Item::TraitDef(node) } | 2810 | fn from(node: Trait) -> Item { Item::Trait(node) } |
2810 | } | 2811 | } |
2811 | impl From<TypeAlias> for Item { | 2812 | impl From<TypeAlias> for Item { |
2812 | fn from(node: TypeAlias) -> Item { Item::TypeAlias(node) } | 2813 | fn from(node: TypeAlias) -> Item { Item::TypeAlias(node) } |
@@ -2820,8 +2821,8 @@ impl From<Use> for Item { | |||
2820 | impl AstNode for Item { | 2821 | impl AstNode for Item { |
2821 | fn can_cast(kind: SyntaxKind) -> bool { | 2822 | fn can_cast(kind: SyntaxKind) -> bool { |
2822 | match kind { | 2823 | match kind { |
2823 | CONST | ENUM | EXTERN_BLOCK | EXTERN_CRATE | FN | IMPL_DEF | MACRO_CALL | MODULE | 2824 | CONST | ENUM | EXTERN_BLOCK | EXTERN_CRATE | FN | IMPL | MACRO_CALL | MODULE |
2824 | | STATIC | STRUCT | TRAIT_DEF | TYPE_ALIAS | UNION | USE => true, | 2825 | | STATIC | STRUCT | TRAIT | TYPE_ALIAS | UNION | USE => true, |
2825 | _ => false, | 2826 | _ => false, |
2826 | } | 2827 | } |
2827 | } | 2828 | } |
@@ -2832,12 +2833,12 @@ impl AstNode for Item { | |||
2832 | EXTERN_BLOCK => Item::ExternBlock(ExternBlock { syntax }), | 2833 | EXTERN_BLOCK => Item::ExternBlock(ExternBlock { syntax }), |
2833 | EXTERN_CRATE => Item::ExternCrate(ExternCrate { syntax }), | 2834 | EXTERN_CRATE => Item::ExternCrate(ExternCrate { syntax }), |
2834 | FN => Item::Fn(Fn { syntax }), | 2835 | FN => Item::Fn(Fn { syntax }), |
2835 | IMPL_DEF => Item::ImplDef(ImplDef { syntax }), | 2836 | IMPL => Item::Impl(Impl { syntax }), |
2836 | MACRO_CALL => Item::MacroCall(MacroCall { syntax }), | 2837 | MACRO_CALL => Item::MacroCall(MacroCall { syntax }), |
2837 | MODULE => Item::Module(Module { syntax }), | 2838 | MODULE => Item::Module(Module { syntax }), |
2838 | STATIC => Item::Static(Static { syntax }), | 2839 | STATIC => Item::Static(Static { syntax }), |
2839 | STRUCT => Item::Struct(Struct { syntax }), | 2840 | STRUCT => Item::Struct(Struct { syntax }), |
2840 | TRAIT_DEF => Item::TraitDef(TraitDef { syntax }), | 2841 | TRAIT => Item::Trait(Trait { syntax }), |
2841 | TYPE_ALIAS => Item::TypeAlias(TypeAlias { syntax }), | 2842 | TYPE_ALIAS => Item::TypeAlias(TypeAlias { syntax }), |
2842 | UNION => Item::Union(Union { syntax }), | 2843 | UNION => Item::Union(Union { syntax }), |
2843 | USE => Item::Use(Use { syntax }), | 2844 | USE => Item::Use(Use { syntax }), |
@@ -2852,12 +2853,12 @@ impl AstNode for Item { | |||
2852 | Item::ExternBlock(it) => &it.syntax, | 2853 | Item::ExternBlock(it) => &it.syntax, |
2853 | Item::ExternCrate(it) => &it.syntax, | 2854 | Item::ExternCrate(it) => &it.syntax, |
2854 | Item::Fn(it) => &it.syntax, | 2855 | Item::Fn(it) => &it.syntax, |
2855 | Item::ImplDef(it) => &it.syntax, | 2856 | Item::Impl(it) => &it.syntax, |
2856 | Item::MacroCall(it) => &it.syntax, | 2857 | Item::MacroCall(it) => &it.syntax, |
2857 | Item::Module(it) => &it.syntax, | 2858 | Item::Module(it) => &it.syntax, |
2858 | Item::Static(it) => &it.syntax, | 2859 | Item::Static(it) => &it.syntax, |
2859 | Item::Struct(it) => &it.syntax, | 2860 | Item::Struct(it) => &it.syntax, |
2860 | Item::TraitDef(it) => &it.syntax, | 2861 | Item::Trait(it) => &it.syntax, |
2861 | Item::TypeAlias(it) => &it.syntax, | 2862 | Item::TypeAlias(it) => &it.syntax, |
2862 | Item::Union(it) => &it.syntax, | 2863 | Item::Union(it) => &it.syntax, |
2863 | Item::Use(it) => &it.syntax, | 2864 | Item::Use(it) => &it.syntax, |
@@ -3491,7 +3492,7 @@ impl std::fmt::Display for Fn { | |||
3491 | std::fmt::Display::fmt(self.syntax(), f) | 3492 | std::fmt::Display::fmt(self.syntax(), f) |
3492 | } | 3493 | } |
3493 | } | 3494 | } |
3494 | impl std::fmt::Display for ImplDef { | 3495 | impl std::fmt::Display for Impl { |
3495 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3496 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3496 | std::fmt::Display::fmt(self.syntax(), f) | 3497 | std::fmt::Display::fmt(self.syntax(), f) |
3497 | } | 3498 | } |
@@ -3516,7 +3517,7 @@ impl std::fmt::Display for Struct { | |||
3516 | std::fmt::Display::fmt(self.syntax(), f) | 3517 | std::fmt::Display::fmt(self.syntax(), f) |
3517 | } | 3518 | } |
3518 | } | 3519 | } |
3519 | impl std::fmt::Display for TraitDef { | 3520 | impl std::fmt::Display for Trait { |
3520 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3521 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3521 | std::fmt::Display::fmt(self.syntax(), f) | 3522 | std::fmt::Display::fmt(self.syntax(), f) |
3522 | } | 3523 | } |