diff options
author | Aleksey Kladov <[email protected]> | 2020-07-30 17:28:28 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-07-30 17:28:28 +0100 |
commit | c5798c4d75aa807aec47208a49101bdec3affcca (patch) | |
tree | 1af0efdcee857e1ba91e76f4cc7fd7c043916ebb /crates/ra_syntax/src/ast/generated | |
parent | c83467796b6c7365ea4f41900d74444384a9e618 (diff) |
Finalize impl Grammar
Diffstat (limited to 'crates/ra_syntax/src/ast/generated')
-rw-r--r-- | crates/ra_syntax/src/ast/generated/nodes.rs | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index 3adb6b2d4..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) } |
@@ -1278,7 +1279,7 @@ 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), |
@@ -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 }) |
@@ -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) } |
@@ -2820,7 +2821,7 @@ 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 | TYPE_ALIAS | UNION | USE => true, | 2825 | | STATIC | STRUCT | TRAIT | TYPE_ALIAS | UNION | USE => true, |
2825 | _ => false, | 2826 | _ => false, |
2826 | } | 2827 | } |
@@ -2832,7 +2833,7 @@ 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 }), |
@@ -2852,7 +2853,7 @@ 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, |
@@ -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 | } |