diff options
author | Aleksey Kladov <[email protected]> | 2020-08-01 12:47:19 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-08-01 12:47:19 +0100 |
commit | bff8dd094958f1abe2fcfe8fe9f15dc7a7e6b53e (patch) | |
tree | cb6e4783b74d04ae2188fb04b652488e97429b99 /crates/ra_syntax/src/ast | |
parent | 5af32aeb2b83c7ae8adf3e088bf4f3691aa45eb1 (diff) |
Update grammar
Diffstat (limited to 'crates/ra_syntax/src/ast')
-rw-r--r-- | crates/ra_syntax/src/ast/generated/nodes.rs | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index 5f51c7536..3d49309d1 100644 --- a/crates/ra_syntax/src/ast/generated/nodes.rs +++ b/crates/ra_syntax/src/ast/generated/nodes.rs | |||
@@ -1006,10 +1006,10 @@ impl DynTraitType { | |||
1006 | pub fn type_bound_list(&self) -> Option<TypeBoundList> { support::child(&self.syntax) } | 1006 | pub fn type_bound_list(&self) -> Option<TypeBoundList> { support::child(&self.syntax) } |
1007 | } | 1007 | } |
1008 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1008 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1009 | pub struct FnPointerType { | 1009 | pub struct FnPtrType { |
1010 | pub(crate) syntax: SyntaxNode, | 1010 | pub(crate) syntax: SyntaxNode, |
1011 | } | 1011 | } |
1012 | impl FnPointerType { | 1012 | impl FnPtrType { |
1013 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } | 1013 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } |
1014 | pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) } | 1014 | pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) } |
1015 | pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } | 1015 | pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } |
@@ -1059,20 +1059,20 @@ impl ParenType { | |||
1059 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } | 1059 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } |
1060 | } | 1060 | } |
1061 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1061 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1062 | pub struct PointerType { | 1062 | pub struct PtrType { |
1063 | pub(crate) syntax: SyntaxNode, | 1063 | pub(crate) syntax: SyntaxNode, |
1064 | } | 1064 | } |
1065 | impl PointerType { | 1065 | impl PtrType { |
1066 | pub fn star_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![*]) } | 1066 | pub fn star_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![*]) } |
1067 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } | 1067 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } |
1068 | pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } | 1068 | pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } |
1069 | pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) } | 1069 | pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) } |
1070 | } | 1070 | } |
1071 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1071 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1072 | pub struct ReferenceType { | 1072 | pub struct RefType { |
1073 | pub(crate) syntax: SyntaxNode, | 1073 | pub(crate) syntax: SyntaxNode, |
1074 | } | 1074 | } |
1075 | impl ReferenceType { | 1075 | impl RefType { |
1076 | pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) } | 1076 | pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) } |
1077 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { | 1077 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { |
1078 | support::token(&self.syntax, T![lifetime]) | 1078 | support::token(&self.syntax, T![lifetime]) |
@@ -1263,15 +1263,15 @@ pub enum GenericArg { | |||
1263 | pub enum Type { | 1263 | pub enum Type { |
1264 | ArrayType(ArrayType), | 1264 | ArrayType(ArrayType), |
1265 | DynTraitType(DynTraitType), | 1265 | DynTraitType(DynTraitType), |
1266 | FnPointerType(FnPointerType), | 1266 | FnPtrType(FnPtrType), |
1267 | ForType(ForType), | 1267 | ForType(ForType), |
1268 | ImplTraitType(ImplTraitType), | 1268 | ImplTraitType(ImplTraitType), |
1269 | InferType(InferType), | 1269 | InferType(InferType), |
1270 | NeverType(NeverType), | 1270 | NeverType(NeverType), |
1271 | ParenType(ParenType), | 1271 | ParenType(ParenType), |
1272 | PathType(PathType), | 1272 | PathType(PathType), |
1273 | PointerType(PointerType), | 1273 | PtrType(PtrType), |
1274 | ReferenceType(ReferenceType), | 1274 | RefType(RefType), |
1275 | SliceType(SliceType), | 1275 | SliceType(SliceType), |
1276 | TupleType(TupleType), | 1276 | TupleType(TupleType), |
1277 | } | 1277 | } |
@@ -1377,8 +1377,8 @@ impl ast::NameOwner for AssocItem {} | |||
1377 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1377 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1378 | pub enum ExternItem { | 1378 | pub enum ExternItem { |
1379 | Fn(Fn), | 1379 | Fn(Fn), |
1380 | Static(Static), | ||
1381 | MacroCall(MacroCall), | 1380 | MacroCall(MacroCall), |
1381 | Static(Static), | ||
1382 | } | 1382 | } |
1383 | impl ast::AttrsOwner for ExternItem {} | 1383 | impl ast::AttrsOwner for ExternItem {} |
1384 | impl ast::NameOwner for ExternItem {} | 1384 | impl ast::NameOwner for ExternItem {} |
@@ -2434,8 +2434,8 @@ impl AstNode for DynTraitType { | |||
2434 | } | 2434 | } |
2435 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2435 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2436 | } | 2436 | } |
2437 | impl AstNode for FnPointerType { | 2437 | impl AstNode for FnPtrType { |
2438 | fn can_cast(kind: SyntaxKind) -> bool { kind == FN_POINTER_TYPE } | 2438 | fn can_cast(kind: SyntaxKind) -> bool { kind == FN_PTR_TYPE } |
2439 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 2439 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
2440 | if Self::can_cast(syntax.kind()) { | 2440 | if Self::can_cast(syntax.kind()) { |
2441 | Some(Self { syntax }) | 2441 | Some(Self { syntax }) |
@@ -2500,8 +2500,8 @@ impl AstNode for ParenType { | |||
2500 | } | 2500 | } |
2501 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2501 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2502 | } | 2502 | } |
2503 | impl AstNode for PointerType { | 2503 | impl AstNode for PtrType { |
2504 | fn can_cast(kind: SyntaxKind) -> bool { kind == POINTER_TYPE } | 2504 | fn can_cast(kind: SyntaxKind) -> bool { kind == PTR_TYPE } |
2505 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 2505 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
2506 | if Self::can_cast(syntax.kind()) { | 2506 | if Self::can_cast(syntax.kind()) { |
2507 | Some(Self { syntax }) | 2507 | Some(Self { syntax }) |
@@ -2511,8 +2511,8 @@ impl AstNode for PointerType { | |||
2511 | } | 2511 | } |
2512 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2512 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2513 | } | 2513 | } |
2514 | impl AstNode for ReferenceType { | 2514 | impl AstNode for RefType { |
2515 | fn can_cast(kind: SyntaxKind) -> bool { kind == REFERENCE_TYPE } | 2515 | fn can_cast(kind: SyntaxKind) -> bool { kind == REF_TYPE } |
2516 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 2516 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
2517 | if Self::can_cast(syntax.kind()) { | 2517 | if Self::can_cast(syntax.kind()) { |
2518 | Some(Self { syntax }) | 2518 | Some(Self { syntax }) |
@@ -2786,8 +2786,8 @@ impl From<ArrayType> for Type { | |||
2786 | impl From<DynTraitType> for Type { | 2786 | impl From<DynTraitType> for Type { |
2787 | fn from(node: DynTraitType) -> Type { Type::DynTraitType(node) } | 2787 | fn from(node: DynTraitType) -> Type { Type::DynTraitType(node) } |
2788 | } | 2788 | } |
2789 | impl From<FnPointerType> for Type { | 2789 | impl From<FnPtrType> for Type { |
2790 | fn from(node: FnPointerType) -> Type { Type::FnPointerType(node) } | 2790 | fn from(node: FnPtrType) -> Type { Type::FnPtrType(node) } |
2791 | } | 2791 | } |
2792 | impl From<ForType> for Type { | 2792 | impl From<ForType> for Type { |
2793 | fn from(node: ForType) -> Type { Type::ForType(node) } | 2793 | fn from(node: ForType) -> Type { Type::ForType(node) } |
@@ -2807,11 +2807,11 @@ impl From<ParenType> for Type { | |||
2807 | impl From<PathType> for Type { | 2807 | impl From<PathType> for Type { |
2808 | fn from(node: PathType) -> Type { Type::PathType(node) } | 2808 | fn from(node: PathType) -> Type { Type::PathType(node) } |
2809 | } | 2809 | } |
2810 | impl From<PointerType> for Type { | 2810 | impl From<PtrType> for Type { |
2811 | fn from(node: PointerType) -> Type { Type::PointerType(node) } | 2811 | fn from(node: PtrType) -> Type { Type::PtrType(node) } |
2812 | } | 2812 | } |
2813 | impl From<ReferenceType> for Type { | 2813 | impl From<RefType> for Type { |
2814 | fn from(node: ReferenceType) -> Type { Type::ReferenceType(node) } | 2814 | fn from(node: RefType) -> Type { Type::RefType(node) } |
2815 | } | 2815 | } |
2816 | impl From<SliceType> for Type { | 2816 | impl From<SliceType> for Type { |
2817 | fn from(node: SliceType) -> Type { Type::SliceType(node) } | 2817 | fn from(node: SliceType) -> Type { Type::SliceType(node) } |
@@ -2822,9 +2822,9 @@ impl From<TupleType> for Type { | |||
2822 | impl AstNode for Type { | 2822 | impl AstNode for Type { |
2823 | fn can_cast(kind: SyntaxKind) -> bool { | 2823 | fn can_cast(kind: SyntaxKind) -> bool { |
2824 | match kind { | 2824 | match kind { |
2825 | ARRAY_TYPE | DYN_TRAIT_TYPE | FN_POINTER_TYPE | FOR_TYPE | IMPL_TRAIT_TYPE | 2825 | ARRAY_TYPE | DYN_TRAIT_TYPE | FN_PTR_TYPE | FOR_TYPE | IMPL_TRAIT_TYPE | INFER_TYPE |
2826 | | INFER_TYPE | NEVER_TYPE | PAREN_TYPE | PATH_TYPE | POINTER_TYPE | REFERENCE_TYPE | 2826 | | NEVER_TYPE | PAREN_TYPE | PATH_TYPE | PTR_TYPE | REF_TYPE | SLICE_TYPE |
2827 | | SLICE_TYPE | TUPLE_TYPE => true, | 2827 | | TUPLE_TYPE => true, |
2828 | _ => false, | 2828 | _ => false, |
2829 | } | 2829 | } |
2830 | } | 2830 | } |
@@ -2832,15 +2832,15 @@ impl AstNode for Type { | |||
2832 | let res = match syntax.kind() { | 2832 | let res = match syntax.kind() { |
2833 | ARRAY_TYPE => Type::ArrayType(ArrayType { syntax }), | 2833 | ARRAY_TYPE => Type::ArrayType(ArrayType { syntax }), |
2834 | DYN_TRAIT_TYPE => Type::DynTraitType(DynTraitType { syntax }), | 2834 | DYN_TRAIT_TYPE => Type::DynTraitType(DynTraitType { syntax }), |
2835 | FN_POINTER_TYPE => Type::FnPointerType(FnPointerType { syntax }), | 2835 | FN_PTR_TYPE => Type::FnPtrType(FnPtrType { syntax }), |
2836 | FOR_TYPE => Type::ForType(ForType { syntax }), | 2836 | FOR_TYPE => Type::ForType(ForType { syntax }), |
2837 | IMPL_TRAIT_TYPE => Type::ImplTraitType(ImplTraitType { syntax }), | 2837 | IMPL_TRAIT_TYPE => Type::ImplTraitType(ImplTraitType { syntax }), |
2838 | INFER_TYPE => Type::InferType(InferType { syntax }), | 2838 | INFER_TYPE => Type::InferType(InferType { syntax }), |
2839 | NEVER_TYPE => Type::NeverType(NeverType { syntax }), | 2839 | NEVER_TYPE => Type::NeverType(NeverType { syntax }), |
2840 | PAREN_TYPE => Type::ParenType(ParenType { syntax }), | 2840 | PAREN_TYPE => Type::ParenType(ParenType { syntax }), |
2841 | PATH_TYPE => Type::PathType(PathType { syntax }), | 2841 | PATH_TYPE => Type::PathType(PathType { syntax }), |
2842 | POINTER_TYPE => Type::PointerType(PointerType { syntax }), | 2842 | PTR_TYPE => Type::PtrType(PtrType { syntax }), |
2843 | REFERENCE_TYPE => Type::ReferenceType(ReferenceType { syntax }), | 2843 | REF_TYPE => Type::RefType(RefType { syntax }), |
2844 | SLICE_TYPE => Type::SliceType(SliceType { syntax }), | 2844 | SLICE_TYPE => Type::SliceType(SliceType { syntax }), |
2845 | TUPLE_TYPE => Type::TupleType(TupleType { syntax }), | 2845 | TUPLE_TYPE => Type::TupleType(TupleType { syntax }), |
2846 | _ => return None, | 2846 | _ => return None, |
@@ -2851,15 +2851,15 @@ impl AstNode for Type { | |||
2851 | match self { | 2851 | match self { |
2852 | Type::ArrayType(it) => &it.syntax, | 2852 | Type::ArrayType(it) => &it.syntax, |
2853 | Type::DynTraitType(it) => &it.syntax, | 2853 | Type::DynTraitType(it) => &it.syntax, |
2854 | Type::FnPointerType(it) => &it.syntax, | 2854 | Type::FnPtrType(it) => &it.syntax, |
2855 | Type::ForType(it) => &it.syntax, | 2855 | Type::ForType(it) => &it.syntax, |
2856 | Type::ImplTraitType(it) => &it.syntax, | 2856 | Type::ImplTraitType(it) => &it.syntax, |
2857 | Type::InferType(it) => &it.syntax, | 2857 | Type::InferType(it) => &it.syntax, |
2858 | Type::NeverType(it) => &it.syntax, | 2858 | Type::NeverType(it) => &it.syntax, |
2859 | Type::ParenType(it) => &it.syntax, | 2859 | Type::ParenType(it) => &it.syntax, |
2860 | Type::PathType(it) => &it.syntax, | 2860 | Type::PathType(it) => &it.syntax, |
2861 | Type::PointerType(it) => &it.syntax, | 2861 | Type::PtrType(it) => &it.syntax, |
2862 | Type::ReferenceType(it) => &it.syntax, | 2862 | Type::RefType(it) => &it.syntax, |
2863 | Type::SliceType(it) => &it.syntax, | 2863 | Type::SliceType(it) => &it.syntax, |
2864 | Type::TupleType(it) => &it.syntax, | 2864 | Type::TupleType(it) => &it.syntax, |
2865 | } | 2865 | } |
@@ -3332,24 +3332,24 @@ impl AstNode for AssocItem { | |||
3332 | impl From<Fn> for ExternItem { | 3332 | impl From<Fn> for ExternItem { |
3333 | fn from(node: Fn) -> ExternItem { ExternItem::Fn(node) } | 3333 | fn from(node: Fn) -> ExternItem { ExternItem::Fn(node) } |
3334 | } | 3334 | } |
3335 | impl From<Static> for ExternItem { | ||
3336 | fn from(node: Static) -> ExternItem { ExternItem::Static(node) } | ||
3337 | } | ||
3338 | impl From<MacroCall> for ExternItem { | 3335 | impl From<MacroCall> for ExternItem { |
3339 | fn from(node: MacroCall) -> ExternItem { ExternItem::MacroCall(node) } | 3336 | fn from(node: MacroCall) -> ExternItem { ExternItem::MacroCall(node) } |
3340 | } | 3337 | } |
3338 | impl From<Static> for ExternItem { | ||
3339 | fn from(node: Static) -> ExternItem { ExternItem::Static(node) } | ||
3340 | } | ||
3341 | impl AstNode for ExternItem { | 3341 | impl AstNode for ExternItem { |
3342 | fn can_cast(kind: SyntaxKind) -> bool { | 3342 | fn can_cast(kind: SyntaxKind) -> bool { |
3343 | match kind { | 3343 | match kind { |
3344 | FN | STATIC | MACRO_CALL => true, | 3344 | FN | MACRO_CALL | STATIC => true, |
3345 | _ => false, | 3345 | _ => false, |
3346 | } | 3346 | } |
3347 | } | 3347 | } |
3348 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 3348 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
3349 | let res = match syntax.kind() { | 3349 | let res = match syntax.kind() { |
3350 | FN => ExternItem::Fn(Fn { syntax }), | 3350 | FN => ExternItem::Fn(Fn { syntax }), |
3351 | STATIC => ExternItem::Static(Static { syntax }), | ||
3352 | MACRO_CALL => ExternItem::MacroCall(MacroCall { syntax }), | 3351 | MACRO_CALL => ExternItem::MacroCall(MacroCall { syntax }), |
3352 | STATIC => ExternItem::Static(Static { syntax }), | ||
3353 | _ => return None, | 3353 | _ => return None, |
3354 | }; | 3354 | }; |
3355 | Some(res) | 3355 | Some(res) |
@@ -3357,8 +3357,8 @@ impl AstNode for ExternItem { | |||
3357 | fn syntax(&self) -> &SyntaxNode { | 3357 | fn syntax(&self) -> &SyntaxNode { |
3358 | match self { | 3358 | match self { |
3359 | ExternItem::Fn(it) => &it.syntax, | 3359 | ExternItem::Fn(it) => &it.syntax, |
3360 | ExternItem::Static(it) => &it.syntax, | ||
3361 | ExternItem::MacroCall(it) => &it.syntax, | 3360 | ExternItem::MacroCall(it) => &it.syntax, |
3361 | ExternItem::Static(it) => &it.syntax, | ||
3362 | } | 3362 | } |
3363 | } | 3363 | } |
3364 | } | 3364 | } |
@@ -3925,7 +3925,7 @@ impl std::fmt::Display for DynTraitType { | |||
3925 | std::fmt::Display::fmt(self.syntax(), f) | 3925 | std::fmt::Display::fmt(self.syntax(), f) |
3926 | } | 3926 | } |
3927 | } | 3927 | } |
3928 | impl std::fmt::Display for FnPointerType { | 3928 | impl std::fmt::Display for FnPtrType { |
3929 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3929 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3930 | std::fmt::Display::fmt(self.syntax(), f) | 3930 | std::fmt::Display::fmt(self.syntax(), f) |
3931 | } | 3931 | } |
@@ -3955,12 +3955,12 @@ impl std::fmt::Display for ParenType { | |||
3955 | std::fmt::Display::fmt(self.syntax(), f) | 3955 | std::fmt::Display::fmt(self.syntax(), f) |
3956 | } | 3956 | } |
3957 | } | 3957 | } |
3958 | impl std::fmt::Display for PointerType { | 3958 | impl std::fmt::Display for PtrType { |
3959 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3959 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3960 | std::fmt::Display::fmt(self.syntax(), f) | 3960 | std::fmt::Display::fmt(self.syntax(), f) |
3961 | } | 3961 | } |
3962 | } | 3962 | } |
3963 | impl std::fmt::Display for ReferenceType { | 3963 | impl std::fmt::Display for RefType { |
3964 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3964 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3965 | std::fmt::Display::fmt(self.syntax(), f) | 3965 | std::fmt::Display::fmt(self.syntax(), f) |
3966 | } | 3966 | } |