aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/libsyntax2/src')
-rw-r--r--crates/libsyntax2/src/ast/generated.rs14
-rw-r--r--crates/libsyntax2/src/grammar.ron14
-rw-r--r--crates/libsyntax2/src/grammar/items/mod.rs14
-rw-r--r--crates/libsyntax2/src/syntax_kinds/generated.rs28
4 files changed, 35 insertions, 35 deletions
diff --git a/crates/libsyntax2/src/ast/generated.rs b/crates/libsyntax2/src/ast/generated.rs
index b1fd0a8ad..a557e6d73 100644
--- a/crates/libsyntax2/src/ast/generated.rs
+++ b/crates/libsyntax2/src/ast/generated.rs
@@ -14,7 +14,7 @@ pub struct ConstItem<R: TreeRoot = Arc<SyntaxRoot>> {
14impl<R: TreeRoot> AstNode<R> for ConstItem<R> { 14impl<R: TreeRoot> AstNode<R> for ConstItem<R> {
15 fn cast(syntax: SyntaxNode<R>) -> Option<Self> { 15 fn cast(syntax: SyntaxNode<R>) -> Option<Self> {
16 match syntax.kind() { 16 match syntax.kind() {
17 CONST_ITEM => Some(ConstItem { syntax }), 17 CONST_DEF => Some(ConstItem { syntax }),
18 _ => None, 18 _ => None,
19 } 19 }
20 } 20 }
@@ -33,7 +33,7 @@ pub struct Enum<R: TreeRoot = Arc<SyntaxRoot>> {
33impl<R: TreeRoot> AstNode<R> for Enum<R> { 33impl<R: TreeRoot> AstNode<R> for Enum<R> {
34 fn cast(syntax: SyntaxNode<R>) -> Option<Self> { 34 fn cast(syntax: SyntaxNode<R>) -> Option<Self> {
35 match syntax.kind() { 35 match syntax.kind() {
36 ENUM => Some(Enum { syntax }), 36 ENUM_DEF => Some(Enum { syntax }),
37 _ => None, 37 _ => None,
38 } 38 }
39 } 39 }
@@ -76,7 +76,7 @@ pub struct Function<R: TreeRoot = Arc<SyntaxRoot>> {
76impl<R: TreeRoot> AstNode<R> for Function<R> { 76impl<R: TreeRoot> AstNode<R> for Function<R> {
77 fn cast(syntax: SyntaxNode<R>) -> Option<Self> { 77 fn cast(syntax: SyntaxNode<R>) -> Option<Self> {
78 match syntax.kind() { 78 match syntax.kind() {
79 FUNCTION => Some(Function { syntax }), 79 FN_DEF => Some(Function { syntax }),
80 _ => None, 80 _ => None,
81 } 81 }
82 } 82 }
@@ -150,7 +150,7 @@ pub struct StaticItem<R: TreeRoot = Arc<SyntaxRoot>> {
150impl<R: TreeRoot> AstNode<R> for StaticItem<R> { 150impl<R: TreeRoot> AstNode<R> for StaticItem<R> {
151 fn cast(syntax: SyntaxNode<R>) -> Option<Self> { 151 fn cast(syntax: SyntaxNode<R>) -> Option<Self> {
152 match syntax.kind() { 152 match syntax.kind() {
153 STATIC_ITEM => Some(StaticItem { syntax }), 153 STATIC_DEF => Some(StaticItem { syntax }),
154 _ => None, 154 _ => None,
155 } 155 }
156 } 156 }
@@ -169,7 +169,7 @@ pub struct Struct<R: TreeRoot = Arc<SyntaxRoot>> {
169impl<R: TreeRoot> AstNode<R> for Struct<R> { 169impl<R: TreeRoot> AstNode<R> for Struct<R> {
170 fn cast(syntax: SyntaxNode<R>) -> Option<Self> { 170 fn cast(syntax: SyntaxNode<R>) -> Option<Self> {
171 match syntax.kind() { 171 match syntax.kind() {
172 STRUCT => Some(Struct { syntax }), 172 STRUCT_DEF => Some(Struct { syntax }),
173 _ => None, 173 _ => None,
174 } 174 }
175 } 175 }
@@ -188,7 +188,7 @@ pub struct Trait<R: TreeRoot = Arc<SyntaxRoot>> {
188impl<R: TreeRoot> AstNode<R> for Trait<R> { 188impl<R: TreeRoot> AstNode<R> for Trait<R> {
189 fn cast(syntax: SyntaxNode<R>) -> Option<Self> { 189 fn cast(syntax: SyntaxNode<R>) -> Option<Self> {
190 match syntax.kind() { 190 match syntax.kind() {
191 TRAIT => Some(Trait { syntax }), 191 TRAIT_DEF => Some(Trait { syntax }),
192 _ => None, 192 _ => None,
193 } 193 }
194 } 194 }
@@ -207,7 +207,7 @@ pub struct TypeItem<R: TreeRoot = Arc<SyntaxRoot>> {
207impl<R: TreeRoot> AstNode<R> for TypeItem<R> { 207impl<R: TreeRoot> AstNode<R> for TypeItem<R> {
208 fn cast(syntax: SyntaxNode<R>) -> Option<Self> { 208 fn cast(syntax: SyntaxNode<R>) -> Option<Self> {
209 match syntax.kind() { 209 match syntax.kind() {
210 TYPE_ITEM => Some(TypeItem { syntax }), 210 TYPE_DEF => Some(TypeItem { syntax }),
211 _ => None, 211 _ => None,
212 } 212 }
213 } 213 }
diff --git a/crates/libsyntax2/src/grammar.ron b/crates/libsyntax2/src/grammar.ron
index c07ed4203..16300af41 100644
--- a/crates/libsyntax2/src/grammar.ron
+++ b/crates/libsyntax2/src/grammar.ron
@@ -109,17 +109,17 @@ Grammar(
109 nodes: [ 109 nodes: [
110 "FILE", 110 "FILE",
111 111
112 "STRUCT", 112 "STRUCT_DEF",
113 "ENUM", 113 "ENUM_DEF",
114 "FUNCTION", 114 "FN_DEF",
115 "EXTERN_CRATE_ITEM", 115 "EXTERN_CRATE_ITEM",
116 "MODULE", 116 "MODULE",
117 "USE_ITEM", 117 "USE_ITEM",
118 "STATIC_ITEM", 118 "STATIC_DEF",
119 "CONST_ITEM", 119 "CONST_DEF",
120 "TRAIT", 120 "TRAIT_DEF",
121 "IMPL_ITEM", 121 "IMPL_ITEM",
122 "TYPE_ITEM", 122 "TYPE_DEF",
123 "MACRO_CALL", 123 "MACRO_CALL",
124 "TOKEN_TREE", 124 "TOKEN_TREE",
125 125
diff --git a/crates/libsyntax2/src/grammar/items/mod.rs b/crates/libsyntax2/src/grammar/items/mod.rs
index 6f401ea1b..c3893937a 100644
--- a/crates/libsyntax2/src/grammar/items/mod.rs
+++ b/crates/libsyntax2/src/grammar/items/mod.rs
@@ -108,7 +108,7 @@ pub(super) fn maybe_item(p: &mut Parser) -> MaybeItem {
108 // unsafe fn foo() {} 108 // unsafe fn foo() {}
109 FN_KW => { 109 FN_KW => {
110 function(p); 110 function(p);
111 FUNCTION 111 FN_DEF
112 } 112 }
113 113
114 // test unsafe_trait 114 // test unsafe_trait
@@ -121,7 +121,7 @@ pub(super) fn maybe_item(p: &mut Parser) -> MaybeItem {
121 // unsafe auto trait T {} 121 // unsafe auto trait T {}
122 TRAIT_KW => { 122 TRAIT_KW => {
123 traits::trait_item(p); 123 traits::trait_item(p);
124 TRAIT 124 TRAIT_DEF
125 } 125 }
126 126
127 // test unsafe_impl 127 // test unsafe_impl
@@ -157,7 +157,7 @@ fn items_without_modifiers(p: &mut Parser) -> Option<SyntaxKind> {
157 } 157 }
158 TYPE_KW => { 158 TYPE_KW => {
159 type_item(p); 159 type_item(p);
160 TYPE_ITEM 160 TYPE_DEF
161 } 161 }
162 MOD_KW => { 162 MOD_KW => {
163 mod_item(p); 163 mod_item(p);
@@ -171,11 +171,11 @@ fn items_without_modifiers(p: &mut Parser) -> Option<SyntaxKind> {
171 consider removing this semicolon" 171 consider removing this semicolon"
172 ); 172 );
173 } 173 }
174 STRUCT 174 STRUCT_DEF
175 } 175 }
176 ENUM_KW => { 176 ENUM_KW => {
177 structs::enum_item(p); 177 structs::enum_item(p);
178 ENUM 178 ENUM_DEF
179 } 179 }
180 USE_KW => { 180 USE_KW => {
181 use_item::use_item(p); 181 use_item::use_item(p);
@@ -183,11 +183,11 @@ fn items_without_modifiers(p: &mut Parser) -> Option<SyntaxKind> {
183 } 183 }
184 CONST_KW if (la == IDENT || la == MUT_KW) => { 184 CONST_KW if (la == IDENT || la == MUT_KW) => {
185 consts::const_item(p); 185 consts::const_item(p);
186 CONST_ITEM 186 CONST_DEF
187 } 187 }
188 STATIC_KW => { 188 STATIC_KW => {
189 consts::static_item(p); 189 consts::static_item(p);
190 STATIC_ITEM 190 STATIC_DEF
191 } 191 }
192 // test extern_block 192 // test extern_block
193 // extern {} 193 // extern {}
diff --git a/crates/libsyntax2/src/syntax_kinds/generated.rs b/crates/libsyntax2/src/syntax_kinds/generated.rs
index f5f8fe1ef..b04dfe55c 100644
--- a/crates/libsyntax2/src/syntax_kinds/generated.rs
+++ b/crates/libsyntax2/src/syntax_kinds/generated.rs
@@ -109,17 +109,17 @@ pub enum SyntaxKind {
109 DOC_COMMENT, 109 DOC_COMMENT,
110 SHEBANG, 110 SHEBANG,
111 FILE, 111 FILE,
112 STRUCT, 112 STRUCT_DEF,
113 ENUM, 113 ENUM_DEF,
114 FUNCTION, 114 FN_DEF,
115 EXTERN_CRATE_ITEM, 115 EXTERN_CRATE_ITEM,
116 MODULE, 116 MODULE,
117 USE_ITEM, 117 USE_ITEM,
118 STATIC_ITEM, 118 STATIC_DEF,
119 CONST_ITEM, 119 CONST_DEF,
120 TRAIT, 120 TRAIT_DEF,
121 IMPL_ITEM, 121 IMPL_ITEM,
122 TYPE_ITEM, 122 TYPE_DEF,
123 MACRO_CALL, 123 MACRO_CALL,
124 TOKEN_TREE, 124 TOKEN_TREE,
125 PAREN_TYPE, 125 PAREN_TYPE,
@@ -347,17 +347,17 @@ impl SyntaxKind {
347 DOC_COMMENT => &SyntaxInfo { name: "DOC_COMMENT" }, 347 DOC_COMMENT => &SyntaxInfo { name: "DOC_COMMENT" },
348 SHEBANG => &SyntaxInfo { name: "SHEBANG" }, 348 SHEBANG => &SyntaxInfo { name: "SHEBANG" },
349 FILE => &SyntaxInfo { name: "FILE" }, 349 FILE => &SyntaxInfo { name: "FILE" },
350 STRUCT => &SyntaxInfo { name: "STRUCT" }, 350 STRUCT_DEF => &SyntaxInfo { name: "STRUCT_DEF" },
351 ENUM => &SyntaxInfo { name: "ENUM" }, 351 ENUM_DEF => &SyntaxInfo { name: "ENUM_DEF" },
352 FUNCTION => &SyntaxInfo { name: "FUNCTION" }, 352 FN_DEF => &SyntaxInfo { name: "FN_DEF" },
353 EXTERN_CRATE_ITEM => &SyntaxInfo { name: "EXTERN_CRATE_ITEM" }, 353 EXTERN_CRATE_ITEM => &SyntaxInfo { name: "EXTERN_CRATE_ITEM" },
354 MODULE => &SyntaxInfo { name: "MODULE" }, 354 MODULE => &SyntaxInfo { name: "MODULE" },
355 USE_ITEM => &SyntaxInfo { name: "USE_ITEM" }, 355 USE_ITEM => &SyntaxInfo { name: "USE_ITEM" },
356 STATIC_ITEM => &SyntaxInfo { name: "STATIC_ITEM" }, 356 STATIC_DEF => &SyntaxInfo { name: "STATIC_DEF" },
357 CONST_ITEM => &SyntaxInfo { name: "CONST_ITEM" }, 357 CONST_DEF => &SyntaxInfo { name: "CONST_DEF" },
358 TRAIT => &SyntaxInfo { name: "TRAIT" }, 358 TRAIT_DEF => &SyntaxInfo { name: "TRAIT_DEF" },
359 IMPL_ITEM => &SyntaxInfo { name: "IMPL_ITEM" }, 359 IMPL_ITEM => &SyntaxInfo { name: "IMPL_ITEM" },
360 TYPE_ITEM => &SyntaxInfo { name: "TYPE_ITEM" }, 360 TYPE_DEF => &SyntaxInfo { name: "TYPE_DEF" },
361 MACRO_CALL => &SyntaxInfo { name: "MACRO_CALL" }, 361 MACRO_CALL => &SyntaxInfo { name: "MACRO_CALL" },
362 TOKEN_TREE => &SyntaxInfo { name: "TOKEN_TREE" }, 362 TOKEN_TREE => &SyntaxInfo { name: "TOKEN_TREE" },
363 PAREN_TYPE => &SyntaxInfo { name: "PAREN_TYPE" }, 363 PAREN_TYPE => &SyntaxInfo { name: "PAREN_TYPE" },