diff options
Diffstat (limited to 'crates/ra_syntax')
21 files changed, 111 insertions, 110 deletions
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs index b69b6e85e..fd426ece9 100644 --- a/crates/ra_syntax/src/ast.rs +++ b/crates/ra_syntax/src/ast.rs | |||
@@ -139,7 +139,7 @@ fn test_doc_comment_of_statics() { | |||
139 | ) | 139 | ) |
140 | .ok() | 140 | .ok() |
141 | .unwrap(); | 141 | .unwrap(); |
142 | let st = file.syntax().descendants().find_map(StaticDef::cast).unwrap(); | 142 | let st = file.syntax().descendants().find_map(Static::cast).unwrap(); |
143 | assert_eq!("Number of levels", st.doc_comment_text().unwrap()); | 143 | assert_eq!("Number of levels", st.doc_comment_text().unwrap()); |
144 | } | 144 | } |
145 | 145 | ||
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index 1d1452546..00a70fce0 100644 --- a/crates/ra_syntax/src/ast/generated/nodes.rs +++ b/crates/ra_syntax/src/ast/generated/nodes.rs | |||
@@ -28,16 +28,17 @@ impl Attr { | |||
28 | pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) } | 28 | pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) } |
29 | } | 29 | } |
30 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 30 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
31 | pub struct ConstDef { | 31 | pub struct Const { |
32 | pub(crate) syntax: SyntaxNode, | 32 | pub(crate) syntax: SyntaxNode, |
33 | } | 33 | } |
34 | impl ast::AttrsOwner for ConstDef {} | 34 | impl ast::AttrsOwner for Const {} |
35 | impl ast::NameOwner for ConstDef {} | 35 | impl ast::NameOwner for Const {} |
36 | impl ast::VisibilityOwner for ConstDef {} | 36 | impl ast::VisibilityOwner for Const {} |
37 | impl ast::TypeAscriptionOwner for ConstDef {} | 37 | impl ast::TypeAscriptionOwner for Const {} |
38 | impl ConstDef { | 38 | impl Const { |
39 | pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } | 39 | pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } |
40 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } | 40 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } |
41 | pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) } | ||
41 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } | 42 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } |
42 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } | 43 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
43 | pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) } | 44 | pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) } |
@@ -53,7 +54,7 @@ impl ast::VisibilityOwner for Enum {} | |||
53 | impl ast::GenericParamsOwner for Enum {} | 54 | impl ast::GenericParamsOwner for Enum {} |
54 | impl Enum { | 55 | impl Enum { |
55 | pub fn enum_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![enum]) } | 56 | pub fn enum_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![enum]) } |
56 | pub fn variant_list(&self) -> Option<EnumVariantList> { support::child(&self.syntax) } | 57 | pub fn variant_list(&self) -> Option<VariantList> { support::child(&self.syntax) } |
57 | } | 58 | } |
58 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 59 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
59 | pub struct ExternBlock { | 60 | pub struct ExternBlock { |
@@ -139,14 +140,14 @@ impl Module { | |||
139 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } | 140 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
140 | } | 141 | } |
141 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 142 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
142 | pub struct StaticDef { | 143 | pub struct Static { |
143 | pub(crate) syntax: SyntaxNode, | 144 | pub(crate) syntax: SyntaxNode, |
144 | } | 145 | } |
145 | impl ast::AttrsOwner for StaticDef {} | 146 | impl ast::AttrsOwner for Static {} |
146 | impl ast::NameOwner for StaticDef {} | 147 | impl ast::NameOwner for Static {} |
147 | impl ast::VisibilityOwner for StaticDef {} | 148 | impl ast::VisibilityOwner for Static {} |
148 | impl ast::TypeAscriptionOwner for StaticDef {} | 149 | impl ast::TypeAscriptionOwner for Static {} |
149 | impl StaticDef { | 150 | impl Static { |
150 | pub fn static_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![static]) } | 151 | pub fn static_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![static]) } |
151 | pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } | 152 | pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } |
152 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } | 153 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } |
@@ -427,22 +428,22 @@ impl TupleField { | |||
427 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 428 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
428 | } | 429 | } |
429 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 430 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
430 | pub struct EnumVariantList { | 431 | pub struct VariantList { |
431 | pub(crate) syntax: SyntaxNode, | 432 | pub(crate) syntax: SyntaxNode, |
432 | } | 433 | } |
433 | impl EnumVariantList { | 434 | impl VariantList { |
434 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } | 435 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } |
435 | pub fn variants(&self) -> AstChildren<EnumVariant> { support::children(&self.syntax) } | 436 | pub fn variants(&self) -> AstChildren<Variant> { support::children(&self.syntax) } |
436 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } | 437 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
437 | } | 438 | } |
438 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 439 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
439 | pub struct EnumVariant { | 440 | pub struct Variant { |
440 | pub(crate) syntax: SyntaxNode, | 441 | pub(crate) syntax: SyntaxNode, |
441 | } | 442 | } |
442 | impl ast::AttrsOwner for EnumVariant {} | 443 | impl ast::AttrsOwner for Variant {} |
443 | impl ast::NameOwner for EnumVariant {} | 444 | impl ast::NameOwner for Variant {} |
444 | impl ast::VisibilityOwner for EnumVariant {} | 445 | impl ast::VisibilityOwner for Variant {} |
445 | impl EnumVariant { | 446 | impl Variant { |
446 | pub fn field_list(&self) -> Option<FieldList> { support::child(&self.syntax) } | 447 | pub fn field_list(&self) -> Option<FieldList> { support::child(&self.syntax) } |
447 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } | 448 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
448 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 449 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
@@ -1272,7 +1273,7 @@ impl MetaItem { | |||
1272 | } | 1273 | } |
1273 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1274 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1274 | pub enum Item { | 1275 | pub enum Item { |
1275 | ConstDef(ConstDef), | 1276 | Const(Const), |
1276 | Enum(Enum), | 1277 | Enum(Enum), |
1277 | ExternBlock(ExternBlock), | 1278 | ExternBlock(ExternBlock), |
1278 | ExternCrate(ExternCrate), | 1279 | ExternCrate(ExternCrate), |
@@ -1280,7 +1281,7 @@ pub enum Item { | |||
1280 | ImplDef(ImplDef), | 1281 | ImplDef(ImplDef), |
1281 | MacroCall(MacroCall), | 1282 | MacroCall(MacroCall), |
1282 | Module(Module), | 1283 | Module(Module), |
1283 | StaticDef(StaticDef), | 1284 | Static(Static), |
1284 | Struct(Struct), | 1285 | Struct(Struct), |
1285 | TraitDef(TraitDef), | 1286 | TraitDef(TraitDef), |
1286 | TypeAlias(TypeAlias), | 1287 | TypeAlias(TypeAlias), |
@@ -1365,7 +1366,7 @@ pub enum Expr { | |||
1365 | pub enum AssocItem { | 1366 | pub enum AssocItem { |
1366 | Fn(Fn), | 1367 | Fn(Fn), |
1367 | TypeAlias(TypeAlias), | 1368 | TypeAlias(TypeAlias), |
1368 | ConstDef(ConstDef), | 1369 | Const(Const), |
1369 | MacroCall(MacroCall), | 1370 | MacroCall(MacroCall), |
1370 | } | 1371 | } |
1371 | impl ast::AttrsOwner for AssocItem {} | 1372 | impl ast::AttrsOwner for AssocItem {} |
@@ -1384,7 +1385,7 @@ pub enum AttrInput { | |||
1384 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1385 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1385 | pub enum ExternItem { | 1386 | pub enum ExternItem { |
1386 | Fn(Fn), | 1387 | Fn(Fn), |
1387 | StaticDef(StaticDef), | 1388 | Static(Static), |
1388 | } | 1389 | } |
1389 | impl ast::AttrsOwner for ExternItem {} | 1390 | impl ast::AttrsOwner for ExternItem {} |
1390 | impl ast::NameOwner for ExternItem {} | 1391 | impl ast::NameOwner for ExternItem {} |
@@ -1421,8 +1422,8 @@ impl AstNode for Attr { | |||
1421 | } | 1422 | } |
1422 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1423 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1423 | } | 1424 | } |
1424 | impl AstNode for ConstDef { | 1425 | impl AstNode for Const { |
1425 | fn can_cast(kind: SyntaxKind) -> bool { kind == CONST_DEF } | 1426 | fn can_cast(kind: SyntaxKind) -> bool { kind == CONST } |
1426 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1427 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1427 | if Self::can_cast(syntax.kind()) { | 1428 | if Self::can_cast(syntax.kind()) { |
1428 | Some(Self { syntax }) | 1429 | Some(Self { syntax }) |
@@ -1509,8 +1510,8 @@ impl AstNode for Module { | |||
1509 | } | 1510 | } |
1510 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1511 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1511 | } | 1512 | } |
1512 | impl AstNode for StaticDef { | 1513 | impl AstNode for Static { |
1513 | fn can_cast(kind: SyntaxKind) -> bool { kind == STATIC_DEF } | 1514 | fn can_cast(kind: SyntaxKind) -> bool { kind == STATIC } |
1514 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1515 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1515 | if Self::can_cast(syntax.kind()) { | 1516 | if Self::can_cast(syntax.kind()) { |
1516 | Some(Self { syntax }) | 1517 | Some(Self { syntax }) |
@@ -1806,8 +1807,8 @@ impl AstNode for TupleField { | |||
1806 | } | 1807 | } |
1807 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1808 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1808 | } | 1809 | } |
1809 | impl AstNode for EnumVariantList { | 1810 | impl AstNode for VariantList { |
1810 | fn can_cast(kind: SyntaxKind) -> bool { kind == ENUM_VARIANT_LIST } | 1811 | fn can_cast(kind: SyntaxKind) -> bool { kind == VARIANT_LIST } |
1811 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1812 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1812 | if Self::can_cast(syntax.kind()) { | 1813 | if Self::can_cast(syntax.kind()) { |
1813 | Some(Self { syntax }) | 1814 | Some(Self { syntax }) |
@@ -1817,8 +1818,8 @@ impl AstNode for EnumVariantList { | |||
1817 | } | 1818 | } |
1818 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1819 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1819 | } | 1820 | } |
1820 | impl AstNode for EnumVariant { | 1821 | impl AstNode for Variant { |
1821 | fn can_cast(kind: SyntaxKind) -> bool { kind == ENUM_VARIANT } | 1822 | fn can_cast(kind: SyntaxKind) -> bool { kind == VARIANT } |
1822 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 1823 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
1823 | if Self::can_cast(syntax.kind()) { | 1824 | if Self::can_cast(syntax.kind()) { |
1824 | Some(Self { syntax }) | 1825 | Some(Self { syntax }) |
@@ -2774,8 +2775,8 @@ impl AstNode for MetaItem { | |||
2774 | } | 2775 | } |
2775 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2776 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2776 | } | 2777 | } |
2777 | impl From<ConstDef> for Item { | 2778 | impl From<Const> for Item { |
2778 | fn from(node: ConstDef) -> Item { Item::ConstDef(node) } | 2779 | fn from(node: Const) -> Item { Item::Const(node) } |
2779 | } | 2780 | } |
2780 | impl From<Enum> for Item { | 2781 | impl From<Enum> for Item { |
2781 | fn from(node: Enum) -> Item { Item::Enum(node) } | 2782 | fn from(node: Enum) -> Item { Item::Enum(node) } |
@@ -2798,8 +2799,8 @@ impl From<MacroCall> for Item { | |||
2798 | impl From<Module> for Item { | 2799 | impl From<Module> for Item { |
2799 | fn from(node: Module) -> Item { Item::Module(node) } | 2800 | fn from(node: Module) -> Item { Item::Module(node) } |
2800 | } | 2801 | } |
2801 | impl From<StaticDef> for Item { | 2802 | impl From<Static> for Item { |
2802 | fn from(node: StaticDef) -> Item { Item::StaticDef(node) } | 2803 | fn from(node: Static) -> Item { Item::Static(node) } |
2803 | } | 2804 | } |
2804 | impl From<Struct> for Item { | 2805 | impl From<Struct> for Item { |
2805 | fn from(node: Struct) -> Item { Item::Struct(node) } | 2806 | fn from(node: Struct) -> Item { Item::Struct(node) } |
@@ -2819,14 +2820,14 @@ impl From<Use> for Item { | |||
2819 | impl AstNode for Item { | 2820 | impl AstNode for Item { |
2820 | fn can_cast(kind: SyntaxKind) -> bool { | 2821 | fn can_cast(kind: SyntaxKind) -> bool { |
2821 | match kind { | 2822 | match kind { |
2822 | CONST_DEF | ENUM | EXTERN_BLOCK | EXTERN_CRATE | FN | IMPL_DEF | MACRO_CALL | 2823 | CONST | ENUM | EXTERN_BLOCK | EXTERN_CRATE | FN | IMPL_DEF | MACRO_CALL | MODULE |
2823 | | MODULE | STATIC_DEF | STRUCT | TRAIT_DEF | TYPE_ALIAS | UNION | USE => true, | 2824 | | STATIC | STRUCT | TRAIT_DEF | TYPE_ALIAS | UNION | USE => true, |
2824 | _ => false, | 2825 | _ => false, |
2825 | } | 2826 | } |
2826 | } | 2827 | } |
2827 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 2828 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
2828 | let res = match syntax.kind() { | 2829 | let res = match syntax.kind() { |
2829 | CONST_DEF => Item::ConstDef(ConstDef { syntax }), | 2830 | CONST => Item::Const(Const { syntax }), |
2830 | ENUM => Item::Enum(Enum { syntax }), | 2831 | ENUM => Item::Enum(Enum { syntax }), |
2831 | EXTERN_BLOCK => Item::ExternBlock(ExternBlock { syntax }), | 2832 | EXTERN_BLOCK => Item::ExternBlock(ExternBlock { syntax }), |
2832 | EXTERN_CRATE => Item::ExternCrate(ExternCrate { syntax }), | 2833 | EXTERN_CRATE => Item::ExternCrate(ExternCrate { syntax }), |
@@ -2834,7 +2835,7 @@ impl AstNode for Item { | |||
2834 | IMPL_DEF => Item::ImplDef(ImplDef { syntax }), | 2835 | IMPL_DEF => Item::ImplDef(ImplDef { syntax }), |
2835 | MACRO_CALL => Item::MacroCall(MacroCall { syntax }), | 2836 | MACRO_CALL => Item::MacroCall(MacroCall { syntax }), |
2836 | MODULE => Item::Module(Module { syntax }), | 2837 | MODULE => Item::Module(Module { syntax }), |
2837 | STATIC_DEF => Item::StaticDef(StaticDef { syntax }), | 2838 | STATIC => Item::Static(Static { syntax }), |
2838 | STRUCT => Item::Struct(Struct { syntax }), | 2839 | STRUCT => Item::Struct(Struct { syntax }), |
2839 | TRAIT_DEF => Item::TraitDef(TraitDef { syntax }), | 2840 | TRAIT_DEF => Item::TraitDef(TraitDef { syntax }), |
2840 | TYPE_ALIAS => Item::TypeAlias(TypeAlias { syntax }), | 2841 | TYPE_ALIAS => Item::TypeAlias(TypeAlias { syntax }), |
@@ -2846,7 +2847,7 @@ impl AstNode for Item { | |||
2846 | } | 2847 | } |
2847 | fn syntax(&self) -> &SyntaxNode { | 2848 | fn syntax(&self) -> &SyntaxNode { |
2848 | match self { | 2849 | match self { |
2849 | Item::ConstDef(it) => &it.syntax, | 2850 | Item::Const(it) => &it.syntax, |
2850 | Item::Enum(it) => &it.syntax, | 2851 | Item::Enum(it) => &it.syntax, |
2851 | Item::ExternBlock(it) => &it.syntax, | 2852 | Item::ExternBlock(it) => &it.syntax, |
2852 | Item::ExternCrate(it) => &it.syntax, | 2853 | Item::ExternCrate(it) => &it.syntax, |
@@ -2854,7 +2855,7 @@ impl AstNode for Item { | |||
2854 | Item::ImplDef(it) => &it.syntax, | 2855 | Item::ImplDef(it) => &it.syntax, |
2855 | Item::MacroCall(it) => &it.syntax, | 2856 | Item::MacroCall(it) => &it.syntax, |
2856 | Item::Module(it) => &it.syntax, | 2857 | Item::Module(it) => &it.syntax, |
2857 | Item::StaticDef(it) => &it.syntax, | 2858 | Item::Static(it) => &it.syntax, |
2858 | Item::Struct(it) => &it.syntax, | 2859 | Item::Struct(it) => &it.syntax, |
2859 | Item::TraitDef(it) => &it.syntax, | 2860 | Item::TraitDef(it) => &it.syntax, |
2860 | Item::TypeAlias(it) => &it.syntax, | 2861 | Item::TypeAlias(it) => &it.syntax, |
@@ -3256,8 +3257,8 @@ impl From<Fn> for AssocItem { | |||
3256 | impl From<TypeAlias> for AssocItem { | 3257 | impl From<TypeAlias> for AssocItem { |
3257 | fn from(node: TypeAlias) -> AssocItem { AssocItem::TypeAlias(node) } | 3258 | fn from(node: TypeAlias) -> AssocItem { AssocItem::TypeAlias(node) } |
3258 | } | 3259 | } |
3259 | impl From<ConstDef> for AssocItem { | 3260 | impl From<Const> for AssocItem { |
3260 | fn from(node: ConstDef) -> AssocItem { AssocItem::ConstDef(node) } | 3261 | fn from(node: Const) -> AssocItem { AssocItem::Const(node) } |
3261 | } | 3262 | } |
3262 | impl From<MacroCall> for AssocItem { | 3263 | impl From<MacroCall> for AssocItem { |
3263 | fn from(node: MacroCall) -> AssocItem { AssocItem::MacroCall(node) } | 3264 | fn from(node: MacroCall) -> AssocItem { AssocItem::MacroCall(node) } |
@@ -3265,7 +3266,7 @@ impl From<MacroCall> for AssocItem { | |||
3265 | impl AstNode for AssocItem { | 3266 | impl AstNode for AssocItem { |
3266 | fn can_cast(kind: SyntaxKind) -> bool { | 3267 | fn can_cast(kind: SyntaxKind) -> bool { |
3267 | match kind { | 3268 | match kind { |
3268 | FN | TYPE_ALIAS | CONST_DEF | MACRO_CALL => true, | 3269 | FN | TYPE_ALIAS | CONST | MACRO_CALL => true, |
3269 | _ => false, | 3270 | _ => false, |
3270 | } | 3271 | } |
3271 | } | 3272 | } |
@@ -3273,7 +3274,7 @@ impl AstNode for AssocItem { | |||
3273 | let res = match syntax.kind() { | 3274 | let res = match syntax.kind() { |
3274 | FN => AssocItem::Fn(Fn { syntax }), | 3275 | FN => AssocItem::Fn(Fn { syntax }), |
3275 | TYPE_ALIAS => AssocItem::TypeAlias(TypeAlias { syntax }), | 3276 | TYPE_ALIAS => AssocItem::TypeAlias(TypeAlias { syntax }), |
3276 | CONST_DEF => AssocItem::ConstDef(ConstDef { syntax }), | 3277 | CONST => AssocItem::Const(Const { syntax }), |
3277 | MACRO_CALL => AssocItem::MacroCall(MacroCall { syntax }), | 3278 | MACRO_CALL => AssocItem::MacroCall(MacroCall { syntax }), |
3278 | _ => return None, | 3279 | _ => return None, |
3279 | }; | 3280 | }; |
@@ -3283,7 +3284,7 @@ impl AstNode for AssocItem { | |||
3283 | match self { | 3284 | match self { |
3284 | AssocItem::Fn(it) => &it.syntax, | 3285 | AssocItem::Fn(it) => &it.syntax, |
3285 | AssocItem::TypeAlias(it) => &it.syntax, | 3286 | AssocItem::TypeAlias(it) => &it.syntax, |
3286 | AssocItem::ConstDef(it) => &it.syntax, | 3287 | AssocItem::Const(it) => &it.syntax, |
3287 | AssocItem::MacroCall(it) => &it.syntax, | 3288 | AssocItem::MacroCall(it) => &it.syntax, |
3288 | } | 3289 | } |
3289 | } | 3290 | } |
@@ -3347,20 +3348,20 @@ impl AstNode for AttrInput { | |||
3347 | impl From<Fn> for ExternItem { | 3348 | impl From<Fn> for ExternItem { |
3348 | fn from(node: Fn) -> ExternItem { ExternItem::Fn(node) } | 3349 | fn from(node: Fn) -> ExternItem { ExternItem::Fn(node) } |
3349 | } | 3350 | } |
3350 | impl From<StaticDef> for ExternItem { | 3351 | impl From<Static> for ExternItem { |
3351 | fn from(node: StaticDef) -> ExternItem { ExternItem::StaticDef(node) } | 3352 | fn from(node: Static) -> ExternItem { ExternItem::Static(node) } |
3352 | } | 3353 | } |
3353 | impl AstNode for ExternItem { | 3354 | impl AstNode for ExternItem { |
3354 | fn can_cast(kind: SyntaxKind) -> bool { | 3355 | fn can_cast(kind: SyntaxKind) -> bool { |
3355 | match kind { | 3356 | match kind { |
3356 | FN | STATIC_DEF => true, | 3357 | FN | STATIC => true, |
3357 | _ => false, | 3358 | _ => false, |
3358 | } | 3359 | } |
3359 | } | 3360 | } |
3360 | fn cast(syntax: SyntaxNode) -> Option<Self> { | 3361 | fn cast(syntax: SyntaxNode) -> Option<Self> { |
3361 | let res = match syntax.kind() { | 3362 | let res = match syntax.kind() { |
3362 | FN => ExternItem::Fn(Fn { syntax }), | 3363 | FN => ExternItem::Fn(Fn { syntax }), |
3363 | STATIC_DEF => ExternItem::StaticDef(StaticDef { syntax }), | 3364 | STATIC => ExternItem::Static(Static { syntax }), |
3364 | _ => return None, | 3365 | _ => return None, |
3365 | }; | 3366 | }; |
3366 | Some(res) | 3367 | Some(res) |
@@ -3368,7 +3369,7 @@ impl AstNode for ExternItem { | |||
3368 | fn syntax(&self) -> &SyntaxNode { | 3369 | fn syntax(&self) -> &SyntaxNode { |
3369 | match self { | 3370 | match self { |
3370 | ExternItem::Fn(it) => &it.syntax, | 3371 | ExternItem::Fn(it) => &it.syntax, |
3371 | ExternItem::StaticDef(it) => &it.syntax, | 3372 | ExternItem::Static(it) => &it.syntax, |
3372 | } | 3373 | } |
3373 | } | 3374 | } |
3374 | } | 3375 | } |
@@ -3465,7 +3466,7 @@ impl std::fmt::Display for Attr { | |||
3465 | std::fmt::Display::fmt(self.syntax(), f) | 3466 | std::fmt::Display::fmt(self.syntax(), f) |
3466 | } | 3467 | } |
3467 | } | 3468 | } |
3468 | impl std::fmt::Display for ConstDef { | 3469 | impl std::fmt::Display for Const { |
3469 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3470 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3470 | std::fmt::Display::fmt(self.syntax(), f) | 3471 | std::fmt::Display::fmt(self.syntax(), f) |
3471 | } | 3472 | } |
@@ -3505,7 +3506,7 @@ impl std::fmt::Display for Module { | |||
3505 | std::fmt::Display::fmt(self.syntax(), f) | 3506 | std::fmt::Display::fmt(self.syntax(), f) |
3506 | } | 3507 | } |
3507 | } | 3508 | } |
3508 | impl std::fmt::Display for StaticDef { | 3509 | impl std::fmt::Display for Static { |
3509 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3510 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3510 | std::fmt::Display::fmt(self.syntax(), f) | 3511 | std::fmt::Display::fmt(self.syntax(), f) |
3511 | } | 3512 | } |
@@ -3640,12 +3641,12 @@ impl std::fmt::Display for TupleField { | |||
3640 | std::fmt::Display::fmt(self.syntax(), f) | 3641 | std::fmt::Display::fmt(self.syntax(), f) |
3641 | } | 3642 | } |
3642 | } | 3643 | } |
3643 | impl std::fmt::Display for EnumVariantList { | 3644 | impl std::fmt::Display for VariantList { |
3644 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3645 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3645 | std::fmt::Display::fmt(self.syntax(), f) | 3646 | std::fmt::Display::fmt(self.syntax(), f) |
3646 | } | 3647 | } |
3647 | } | 3648 | } |
3648 | impl std::fmt::Display for EnumVariant { | 3649 | impl std::fmt::Display for Variant { |
3649 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | 3650 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
3650 | std::fmt::Display::fmt(self.syntax(), f) | 3651 | std::fmt::Display::fmt(self.syntax(), f) |
3651 | } | 3652 | } |
diff --git a/crates/ra_syntax/src/ast/node_ext.rs b/crates/ra_syntax/src/ast/node_ext.rs index 02e6e52c2..4da1d5c11 100644 --- a/crates/ra_syntax/src/ast/node_ext.rs +++ b/crates/ra_syntax/src/ast/node_ext.rs | |||
@@ -247,7 +247,7 @@ impl ast::RecordFieldPat { | |||
247 | } | 247 | } |
248 | } | 248 | } |
249 | 249 | ||
250 | impl ast::EnumVariant { | 250 | impl ast::Variant { |
251 | pub fn parent_enum(&self) -> ast::Enum { | 251 | pub fn parent_enum(&self) -> ast::Enum { |
252 | self.syntax() | 252 | self.syntax() |
253 | .parent() | 253 | .parent() |
@@ -480,11 +480,11 @@ impl ast::DocCommentsOwner for ast::Union {} | |||
480 | impl ast::DocCommentsOwner for ast::RecordField {} | 480 | impl ast::DocCommentsOwner for ast::RecordField {} |
481 | impl ast::DocCommentsOwner for ast::TupleField {} | 481 | impl ast::DocCommentsOwner for ast::TupleField {} |
482 | impl ast::DocCommentsOwner for ast::Enum {} | 482 | impl ast::DocCommentsOwner for ast::Enum {} |
483 | impl ast::DocCommentsOwner for ast::EnumVariant {} | 483 | impl ast::DocCommentsOwner for ast::Variant {} |
484 | impl ast::DocCommentsOwner for ast::TraitDef {} | 484 | impl ast::DocCommentsOwner for ast::TraitDef {} |
485 | impl ast::DocCommentsOwner for ast::Module {} | 485 | impl ast::DocCommentsOwner for ast::Module {} |
486 | impl ast::DocCommentsOwner for ast::StaticDef {} | 486 | impl ast::DocCommentsOwner for ast::Static {} |
487 | impl ast::DocCommentsOwner for ast::ConstDef {} | 487 | impl ast::DocCommentsOwner for ast::Const {} |
488 | impl ast::DocCommentsOwner for ast::TypeAlias {} | 488 | impl ast::DocCommentsOwner for ast::TypeAlias {} |
489 | impl ast::DocCommentsOwner for ast::ImplDef {} | 489 | impl ast::DocCommentsOwner for ast::ImplDef {} |
490 | impl ast::DocCommentsOwner for ast::MacroCall {} | 490 | impl ast::DocCommentsOwner for ast::MacroCall {} |
diff --git a/crates/ra_syntax/src/parsing/text_tree_sink.rs b/crates/ra_syntax/src/parsing/text_tree_sink.rs index faffd0d32..95581a84b 100644 --- a/crates/ra_syntax/src/parsing/text_tree_sink.rs +++ b/crates/ra_syntax/src/parsing/text_tree_sink.rs | |||
@@ -146,8 +146,8 @@ fn n_attached_trivias<'a>( | |||
146 | trivias: impl Iterator<Item = (SyntaxKind, &'a str)>, | 146 | trivias: impl Iterator<Item = (SyntaxKind, &'a str)>, |
147 | ) -> usize { | 147 | ) -> usize { |
148 | match kind { | 148 | match kind { |
149 | MACRO_CALL | CONST_DEF | TYPE_ALIAS | STRUCT | ENUM | ENUM_VARIANT | FN | TRAIT_DEF | 149 | MACRO_CALL | CONST | TYPE_ALIAS | STRUCT | ENUM | VARIANT | FN | TRAIT_DEF | MODULE |
150 | | MODULE | RECORD_FIELD | STATIC_DEF => { | 150 | | RECORD_FIELD | STATIC => { |
151 | let mut res = 0; | 151 | let mut res = 0; |
152 | let mut trivias = trivias.enumerate().peekable(); | 152 | let mut trivias = trivias.enumerate().peekable(); |
153 | 153 | ||
diff --git a/crates/ra_syntax/src/validation.rs b/crates/ra_syntax/src/validation.rs index 5b4e14676..a666b18db 100644 --- a/crates/ra_syntax/src/validation.rs +++ b/crates/ra_syntax/src/validation.rs | |||
@@ -4,7 +4,7 @@ mod block; | |||
4 | 4 | ||
5 | use crate::{ | 5 | use crate::{ |
6 | ast, match_ast, AstNode, SyntaxError, | 6 | ast, match_ast, AstNode, SyntaxError, |
7 | SyntaxKind::{BYTE, BYTE_STRING, CHAR, CONST_DEF, FN, INT_NUMBER, STRING, TYPE_ALIAS}, | 7 | SyntaxKind::{BYTE, BYTE_STRING, CHAR, CONST, FN, INT_NUMBER, STRING, TYPE_ALIAS}, |
8 | SyntaxNode, SyntaxToken, TextSize, T, | 8 | SyntaxNode, SyntaxToken, TextSize, T, |
9 | }; | 9 | }; |
10 | use rustc_lexer::unescape::{ | 10 | use rustc_lexer::unescape::{ |
@@ -200,7 +200,7 @@ fn validate_visibility(vis: ast::Visibility, errors: &mut Vec<SyntaxError>) { | |||
200 | None => return, | 200 | None => return, |
201 | }; | 201 | }; |
202 | match parent.kind() { | 202 | match parent.kind() { |
203 | FN | CONST_DEF | TYPE_ALIAS => (), | 203 | FN | CONST | TYPE_ALIAS => (), |
204 | _ => return, | 204 | _ => return, |
205 | } | 205 | } |
206 | 206 | ||
diff --git a/crates/ra_syntax/test_data/parser/err/0025_nope.rast b/crates/ra_syntax/test_data/parser/err/0025_nope.rast index 94456e48c..fca646557 100644 --- a/crates/ra_syntax/test_data/parser/err/0025_nope.rast +++ b/crates/ra_syntax/test_data/parser/err/0025_nope.rast | |||
@@ -17,15 +17,15 @@ [email protected] | |||
17 | [email protected] | 17 | [email protected] |
18 | [email protected] "Test" | 18 | [email protected] "Test" |
19 | [email protected] " " | 19 | [email protected] " " |
20 | ENUM_[email protected] | 20 | [email protected] |
21 | [email protected] "{" | 21 | [email protected] "{" |
22 | [email protected] "\n " | 22 | [email protected] "\n " |
23 | ENUM_[email protected] | 23 | [email protected] |
24 | [email protected] | 24 | [email protected] |
25 | [email protected] "Var1" | 25 | [email protected] "Var1" |
26 | [email protected] "," | 26 | [email protected] "," |
27 | [email protected] "\n " | 27 | [email protected] "\n " |
28 | ENUM_[email protected] | 28 | [email protected] |
29 | [email protected] | 29 | [email protected] |
30 | [email protected] "Var2" | 30 | [email protected] "Var2" |
31 | [email protected] | 31 | [email protected] |
@@ -39,7 +39,7 @@ [email protected] | |||
39 | [email protected] ")" | 39 | [email protected] ")" |
40 | [email protected] "," | 40 | [email protected] "," |
41 | [email protected] "\n " | 41 | [email protected] "\n " |
42 | ENUM_[email protected] | 42 | [email protected] |
43 | [email protected] | 43 | [email protected] |
44 | [email protected] "Var3" | 44 | [email protected] "Var3" |
45 | [email protected] " " | 45 | [email protected] " " |
@@ -85,10 +85,10 @@ [email protected] | |||
85 | [email protected] | 85 | [email protected] |
86 | [email protected] "Test2" | 86 | [email protected] "Test2" |
87 | [email protected] " " | 87 | [email protected] " " |
88 | ENUM_[email protected] | 88 | [email protected] |
89 | [email protected] "{" | 89 | [email protected] "{" |
90 | [email protected] "\n " | 90 | [email protected] "\n " |
91 | ENUM_[email protected] | 91 | [email protected] |
92 | [email protected] | 92 | [email protected] |
93 | [email protected] "Fine" | 93 | [email protected] "Fine" |
94 | [email protected] "," | 94 | [email protected] "," |
@@ -101,10 +101,10 @@ [email protected] | |||
101 | [email protected] | 101 | [email protected] |
102 | [email protected] "Test3" | 102 | [email protected] "Test3" |
103 | [email protected] " " | 103 | [email protected] " " |
104 | ENUM_[email protected] | 104 | [email protected] |
105 | [email protected] "{" | 105 | [email protected] "{" |
106 | [email protected] "\n " | 106 | [email protected] "\n " |
107 | ENUM_[email protected] | 107 | [email protected] |
108 | [email protected] | 108 | [email protected] |
109 | [email protected] "StillFine" | 109 | [email protected] "StillFine" |
110 | [email protected] " " | 110 | [email protected] " " |
@@ -140,10 +140,10 @@ [email protected] | |||
140 | [email protected] | 140 | [email protected] |
141 | [email protected] "Test4" | 141 | [email protected] "Test4" |
142 | [email protected] " " | 142 | [email protected] " " |
143 | ENUM_[email protected] | 143 | [email protected] |
144 | [email protected] "{" | 144 | [email protected] "{" |
145 | [email protected] "\n " | 145 | [email protected] "\n " |
146 | ENUM_[email protected] | 146 | [email protected] |
147 | [email protected] | 147 | [email protected] |
148 | [email protected] "Nope" | 148 | [email protected] "Nope" |
149 | [email protected] | 149 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rast b/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rast index c0ba4fba9..b1400aa5f 100644 --- a/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rast +++ b/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rast | |||
@@ -65,7 +65,7 @@ [email protected] | |||
65 | [email protected] ")" | 65 | [email protected] ")" |
66 | [email protected] ";" | 66 | [email protected] ";" |
67 | [email protected] "\n " | 67 | [email protected] "\n " |
68 | CONST_DEF@86..115 | 68 | [email protected] |
69 | [email protected] | 69 | [email protected] |
70 | [email protected] "pub" | 70 | [email protected] "pub" |
71 | [email protected] "(" | 71 | [email protected] "(" |
diff --git a/crates/ra_syntax/test_data/parser/err/0043_default_const.rast b/crates/ra_syntax/test_data/parser/err/0043_default_const.rast index 6ca1a4870..f041fa6f7 100644 --- a/crates/ra_syntax/test_data/parser/err/0043_default_const.rast +++ b/crates/ra_syntax/test_data/parser/err/0043_default_const.rast | |||
@@ -14,7 +14,7 @@ [email protected] | |||
14 | [email protected] | 14 | [email protected] |
15 | [email protected] "default" | 15 | [email protected] "default" |
16 | [email protected] " " | 16 | [email protected] " " |
17 | CONST_DEF@20..36 | 17 | [email protected] |
18 | [email protected] "const" | 18 | [email protected] "const" |
19 | [email protected] " " | 19 | [email protected] " " |
20 | [email protected] | 20 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rast b/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rast index d2a18330f..a6e6552a9 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rast | |||
@@ -17,7 +17,7 @@ [email protected] | |||
17 | [email protected] "{" | 17 | [email protected] "{" |
18 | [email protected] "}" | 18 | [email protected] "}" |
19 | [email protected] "\n" | 19 | [email protected] "\n" |
20 | CONST_DEF@25..46 | 20 | [email protected] |
21 | [email protected] "unsafe" | 21 | [email protected] "unsafe" |
22 | [email protected] " " | 22 | [email protected] " " |
23 | [email protected] "const" | 23 | [email protected] "const" |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0013_static_underscore.rast b/crates/ra_syntax/test_data/parser/inline/err/0013_static_underscore.rast index ebcc26e0d..8d761b907 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0013_static_underscore.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0013_static_underscore.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | [email protected] | 1 | [email protected] |
2 | STATIC_DEF@0..18 | 2 | [email protected] |
3 | [email protected] "static" | 3 | [email protected] "static" |
4 | [email protected] " " | 4 | [email protected] " " |
5 | [email protected] | 5 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rast b/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rast index a62ce23e6..955e00dde 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rast | |||
@@ -27,7 +27,7 @@ [email protected] | |||
27 | [email protected] "Clone" | 27 | [email protected] "Clone" |
28 | [email protected] ";" | 28 | [email protected] ";" |
29 | [email protected] "\n " | 29 | [email protected] "\n " |
30 | CONST_DEF@32..45 | 30 | [email protected] |
31 | [email protected] "const" | 31 | [email protected] "const" |
32 | [email protected] " " | 32 | [email protected] " " |
33 | [email protected] | 33 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.rast b/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.rast index 3ae870e17..52181ca0c 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.rast | |||
@@ -26,7 +26,7 @@ [email protected] | |||
26 | [email protected] "i32" | 26 | [email protected] "i32" |
27 | [email protected] ";" | 27 | [email protected] ";" |
28 | [email protected] "\n " | 28 | [email protected] "\n " |
29 | CONST_DEF@31..49 | 29 | [email protected] |
30 | [email protected] "const" | 30 | [email protected] "const" |
31 | [email protected] " " | 31 | [email protected] " " |
32 | [email protected] | 32 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0118_impl_inner_attributes.rast b/crates/ra_syntax/test_data/parser/inline/ok/0118_impl_inner_attributes.rast index 25e6cc170..f2561abd6 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0118_impl_inner_attributes.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0118_impl_inner_attributes.rast | |||
@@ -4,7 +4,7 @@ [email protected] | |||
4 | [email protected] " " | 4 | [email protected] " " |
5 | [email protected] | 5 | [email protected] |
6 | [email protected] "F" | 6 | [email protected] "F" |
7 | ENUM_[email protected] | 7 | [email protected] |
8 | [email protected] "{" | 8 | [email protected] "{" |
9 | [email protected] "}" | 9 | [email protected] "}" |
10 | [email protected] "\n" | 10 | [email protected] "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rast b/crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rast index 9cc8172e0..429a0506e 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rast | |||
@@ -17,15 +17,15 @@ [email protected] | |||
17 | [email protected] | 17 | [email protected] |
18 | [email protected] "LocalEnum" | 18 | [email protected] "LocalEnum" |
19 | [email protected] " " | 19 | [email protected] " " |
20 | ENUM_[email protected] | 20 | [email protected] |
21 | [email protected] "{" | 21 | [email protected] "{" |
22 | [email protected] "\n " | 22 | [email protected] "\n " |
23 | ENUM_[email protected] | 23 | [email protected] |
24 | [email protected] | 24 | [email protected] |
25 | [email protected] "One" | 25 | [email protected] "One" |
26 | [email protected] "," | 26 | [email protected] "," |
27 | [email protected] "\n " | 27 | [email protected] "\n " |
28 | ENUM_[email protected] | 28 | [email protected] |
29 | [email protected] | 29 | [email protected] |
30 | [email protected] "Two" | 30 | [email protected] "Two" |
31 | [email protected] "," | 31 | [email protected] "," |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0150_array_attrs.rast b/crates/ra_syntax/test_data/parser/inline/ok/0150_array_attrs.rast index 3c00a2647..0c35bf2b7 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0150_array_attrs.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0150_array_attrs.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | [email protected] | 1 | [email protected] |
2 | CONST_DEF@0..39 | 2 | [email protected] |
3 | [email protected] "const" | 3 | [email protected] "const" |
4 | [email protected] " " | 4 | [email protected] " " |
5 | [email protected] | 5 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0157_variant_discriminant.rast b/crates/ra_syntax/test_data/parser/inline/ok/0157_variant_discriminant.rast index 0331558d2..a2e05eb2e 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0157_variant_discriminant.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0157_variant_discriminant.rast | |||
@@ -5,10 +5,10 @@ [email protected] | |||
5 | [email protected] | 5 | [email protected] |
6 | [email protected] "E" | 6 | [email protected] "E" |
7 | [email protected] " " | 7 | [email protected] " " |
8 | ENUM_[email protected] | 8 | [email protected] |
9 | [email protected] "{" | 9 | [email protected] "{" |
10 | [email protected] " " | 10 | [email protected] " " |
11 | ENUM_[email protected] | 11 | [email protected] |
12 | [email protected] | 12 | [email protected] |
13 | [email protected] "X" | 13 | [email protected] "X" |
14 | [email protected] | 14 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/ok/0019_enums.rast b/crates/ra_syntax/test_data/parser/ok/0019_enums.rast index 1ffcffc1a..c3df00814 100644 --- a/crates/ra_syntax/test_data/parser/ok/0019_enums.rast +++ b/crates/ra_syntax/test_data/parser/ok/0019_enums.rast | |||
@@ -5,7 +5,7 @@ [email protected] | |||
5 | [email protected] | 5 | [email protected] |
6 | [email protected] "E1" | 6 | [email protected] "E1" |
7 | [email protected] " " | 7 | [email protected] " " |
8 | ENUM_[email protected] | 8 | [email protected] |
9 | [email protected] "{" | 9 | [email protected] "{" |
10 | [email protected] "\n" | 10 | [email protected] "\n" |
11 | [email protected] "}" | 11 | [email protected] "}" |
@@ -22,7 +22,7 @@ [email protected] | |||
22 | [email protected] "T" | 22 | [email protected] "T" |
23 | [email protected] ">" | 23 | [email protected] ">" |
24 | [email protected] " " | 24 | [email protected] " " |
25 | ENUM_[email protected] | 25 | [email protected] |
26 | [email protected] "{" | 26 | [email protected] "{" |
27 | [email protected] "\n" | 27 | [email protected] "\n" |
28 | [email protected] "}" | 28 | [email protected] "}" |
@@ -33,10 +33,10 @@ [email protected] | |||
33 | [email protected] | 33 | [email protected] |
34 | [email protected] "E3" | 34 | [email protected] "E3" |
35 | [email protected] " " | 35 | [email protected] " " |
36 | ENUM_[email protected] | 36 | [email protected] |
37 | [email protected] "{" | 37 | [email protected] "{" |
38 | [email protected] "\n " | 38 | [email protected] "\n " |
39 | ENUM_[email protected] | 39 | [email protected] |
40 | [email protected] | 40 | [email protected] |
41 | [email protected] "X" | 41 | [email protected] "X" |
42 | [email protected] "\n" | 42 | [email protected] "\n" |
@@ -48,10 +48,10 @@ [email protected] | |||
48 | [email protected] | 48 | [email protected] |
49 | [email protected] "E4" | 49 | [email protected] "E4" |
50 | [email protected] " " | 50 | [email protected] " " |
51 | ENUM_[email protected] | 51 | [email protected] |
52 | [email protected] "{" | 52 | [email protected] "{" |
53 | [email protected] "\n " | 53 | [email protected] "\n " |
54 | ENUM_[email protected] | 54 | [email protected] |
55 | [email protected] | 55 | [email protected] |
56 | [email protected] "X" | 56 | [email protected] "X" |
57 | [email protected] "," | 57 | [email protected] "," |
@@ -64,15 +64,15 @@ [email protected] | |||
64 | [email protected] | 64 | [email protected] |
65 | [email protected] "E5" | 65 | [email protected] "E5" |
66 | [email protected] " " | 66 | [email protected] " " |
67 | ENUM_[email protected] | 67 | [email protected] |
68 | [email protected] "{" | 68 | [email protected] "{" |
69 | [email protected] "\n " | 69 | [email protected] "\n " |
70 | ENUM_[email protected] | 70 | [email protected] |
71 | [email protected] | 71 | [email protected] |
72 | [email protected] "A" | 72 | [email protected] "A" |
73 | [email protected] "," | 73 | [email protected] "," |
74 | [email protected] "\n " | 74 | [email protected] "\n " |
75 | ENUM_[email protected] | 75 | [email protected] |
76 | [email protected] | 76 | [email protected] |
77 | [email protected] "B" | 77 | [email protected] "B" |
78 | [email protected] " " | 78 | [email protected] " " |
@@ -82,7 +82,7 @@ [email protected] | |||
82 | [email protected] "92" | 82 | [email protected] "92" |
83 | [email protected] "," | 83 | [email protected] "," |
84 | [email protected] "\n " | 84 | [email protected] "\n " |
85 | ENUM_[email protected] | 85 | [email protected] |
86 | [email protected] | 86 | [email protected] |
87 | [email protected] "C" | 87 | [email protected] "C" |
88 | [email protected] " " | 88 | [email protected] " " |
@@ -119,7 +119,7 @@ [email protected] | |||
119 | [email protected] "}" | 119 | [email protected] "}" |
120 | [email protected] "," | 120 | [email protected] "," |
121 | [email protected] "\n " | 121 | [email protected] "\n " |
122 | ENUM_[email protected] | 122 | [email protected] |
123 | [email protected] | 123 | [email protected] |
124 | [email protected] "F" | 124 | [email protected] "F" |
125 | [email protected] " " | 125 | [email protected] " " |
@@ -128,7 +128,7 @@ [email protected] | |||
128 | [email protected] "}" | 128 | [email protected] "}" |
129 | [email protected] "," | 129 | [email protected] "," |
130 | [email protected] "\n " | 130 | [email protected] "\n " |
131 | ENUM_[email protected] | 131 | [email protected] |
132 | [email protected] | 132 | [email protected] |
133 | [email protected] "D" | 133 | [email protected] "D" |
134 | [email protected] | 134 | [email protected] |
@@ -143,7 +143,7 @@ [email protected] | |||
143 | [email protected] ")" | 143 | [email protected] ")" |
144 | [email protected] "," | 144 | [email protected] "," |
145 | [email protected] "\n " | 145 | [email protected] "\n " |
146 | ENUM_[email protected] | 146 | [email protected] |
147 | [email protected] | 147 | [email protected] |
148 | [email protected] "E" | 148 | [email protected] "E" |
149 | [email protected] | 149 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/ok/0023_static_items.rast b/crates/ra_syntax/test_data/parser/ok/0023_static_items.rast index 97d90dc75..9374cf5e9 100644 --- a/crates/ra_syntax/test_data/parser/ok/0023_static_items.rast +++ b/crates/ra_syntax/test_data/parser/ok/0023_static_items.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | [email protected] | 1 | [email protected] |
2 | STATIC_DEF@0..20 | 2 | [email protected] |
3 | [email protected] "static" | 3 | [email protected] "static" |
4 | [email protected] " " | 4 | [email protected] " " |
5 | [email protected] | 5 | [email protected] |
@@ -18,7 +18,7 @@ [email protected] | |||
18 | [email protected] "1" | 18 | [email protected] "1" |
19 | [email protected] ";" | 19 | [email protected] ";" |
20 | [email protected] "\n" | 20 | [email protected] "\n" |
21 | STATIC_DEF@21..46 | 21 | [email protected] |
22 | [email protected] "static" | 22 | [email protected] "static" |
23 | [email protected] " " | 23 | [email protected] " " |
24 | [email protected] "mut" | 24 | [email protected] "mut" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0024_const_item.rast b/crates/ra_syntax/test_data/parser/ok/0024_const_item.rast index d241f034c..dd1b9c9a0 100644 --- a/crates/ra_syntax/test_data/parser/ok/0024_const_item.rast +++ b/crates/ra_syntax/test_data/parser/ok/0024_const_item.rast | |||
@@ -1,5 +1,5 @@ | |||
1 | [email protected] | 1 | [email protected] |
2 | CONST_DEF@0..17 | 2 | [email protected] |
3 | [email protected] "const" | 3 | [email protected] "const" |
4 | [email protected] " " | 4 | [email protected] " " |
5 | [email protected] "_" | 5 | [email protected] "_" |
@@ -17,7 +17,7 @@ [email protected] | |||
17 | [email protected] "0" | 17 | [email protected] "0" |
18 | [email protected] ";" | 18 | [email protected] ";" |
19 | [email protected] "\n" | 19 | [email protected] "\n" |
20 | CONST_DEF@18..38 | 20 | [email protected] |
21 | [email protected] "const" | 21 | [email protected] "const" |
22 | [email protected] " " | 22 | [email protected] " " |
23 | [email protected] | 23 | [email protected] |
@@ -36,7 +36,7 @@ [email protected] | |||
36 | [email protected] "92" | 36 | [email protected] "92" |
37 | [email protected] ";" | 37 | [email protected] ";" |
38 | [email protected] "\n" | 38 | [email protected] "\n" |
39 | CONST_DEF@39..63 | 39 | [email protected] |
40 | [email protected] "const" | 40 | [email protected] "const" |
41 | [email protected] " " | 41 | [email protected] " " |
42 | [email protected] "mut" | 42 | [email protected] "mut" |
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 9db4f0aa1..7a54fa113 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 | |||
@@ -262,10 +262,10 @@ [email protected] | |||
262 | [email protected] | 262 | [email protected] |
263 | [email protected] "A" | 263 | [email protected] "A" |
264 | [email protected] " " | 264 | [email protected] " " |
265 | ENUM_[email protected] | 265 | [email protected] |
266 | [email protected] "{" | 266 | [email protected] "{" |
267 | [email protected] "\n " | 267 | [email protected] "\n " |
268 | ENUM_[email protected] | 268 | [email protected] |
269 | [email protected] | 269 | [email protected] |
270 | [email protected] "B" | 270 | [email protected] "B" |
271 | [email protected] | 271 | [email protected] |
diff --git a/crates/ra_syntax/test_data/parser/ok/0066_default_const.rast b/crates/ra_syntax/test_data/parser/ok/0066_default_const.rast index 584b2faf1..485efe20c 100644 --- a/crates/ra_syntax/test_data/parser/ok/0066_default_const.rast +++ b/crates/ra_syntax/test_data/parser/ok/0066_default_const.rast | |||
@@ -19,7 +19,7 @@ [email protected] | |||
19 | [email protected] | 19 | [email protected] |
20 | [email protected] "{" | 20 | [email protected] "{" |
21 | [email protected] "\n " | 21 | [email protected] "\n " |
22 | CONST_DEF@19..43 | 22 | [email protected] |
23 | [email protected] "default" | 23 | [email protected] "default" |
24 | [email protected] " " | 24 | [email protected] " " |
25 | [email protected] "const" | 25 | [email protected] "const" |