aboutsummaryrefslogtreecommitdiff
path: root/src/syntax_kinds/generated.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/syntax_kinds/generated.rs')
-rw-r--r--src/syntax_kinds/generated.rs69
1 files changed, 34 insertions, 35 deletions
diff --git a/src/syntax_kinds/generated.rs b/src/syntax_kinds/generated.rs
index d332fd02e..029972bb3 100644
--- a/src/syntax_kinds/generated.rs
+++ b/src/syntax_kinds/generated.rs
@@ -1,6 +1,5 @@
1#![allow(bad_style, missing_docs, unreachable_pub)] 1#![allow(bad_style, missing_docs, unreachable_pub)]
2#![cfg_attr(rustfmt, rustfmt_skip)] 2#![cfg_attr(rustfmt, rustfmt_skip)]
3//! Generated from grammar.ron
4use super::SyntaxInfo; 3use super::SyntaxInfo;
5 4
6/// The kind of syntax node, e.g. `IDENT`, `USE_KW`, or `STRUCT_DEF`. 5/// The kind of syntax node, e.g. `IDENT`, `USE_KW`, or `STRUCT_DEF`.
@@ -138,7 +137,6 @@ pub enum SyntaxKind {
138 VALUE_PARAMETER, 137 VALUE_PARAMETER,
139 BLOCK, 138 BLOCK,
140 LET_STMT, 139 LET_STMT,
141
142 // Technical SyntaxKinds: they appear temporally during parsing, 140 // Technical SyntaxKinds: they appear temporally during parsing,
143 // but never end up in the final tree 141 // but never end up in the final tree
144 #[doc(hidden)] 142 #[doc(hidden)]
@@ -146,7 +144,7 @@ pub enum SyntaxKind {
146 #[doc(hidden)] 144 #[doc(hidden)]
147 EOF, 145 EOF,
148} 146}
149pub(crate) use self::SyntaxKind::*; 147use self::SyntaxKind::*;
150 148
151impl SyntaxKind { 149impl SyntaxKind {
152 pub(crate) fn info(self) -> &'static SyntaxInfo { 150 pub(crate) fn info(self) -> &'static SyntaxInfo {
@@ -289,38 +287,39 @@ impl SyntaxKind {
289 } 287 }
290 } 288 }
291 pub(crate) fn from_keyword(ident: &str) -> Option<SyntaxKind> { 289 pub(crate) fn from_keyword(ident: &str) -> Option<SyntaxKind> {
292 match ident { 290 let kw = match ident {
293 "use" => Some(USE_KW), 291 "use" => USE_KW,
294 "fn" => Some(FN_KW), 292 "fn" => FN_KW,
295 "struct" => Some(STRUCT_KW), 293 "struct" => STRUCT_KW,
296 "enum" => Some(ENUM_KW), 294 "enum" => ENUM_KW,
297 "trait" => Some(TRAIT_KW), 295 "trait" => TRAIT_KW,
298 "impl" => Some(IMPL_KW), 296 "impl" => IMPL_KW,
299 "true" => Some(TRUE_KW), 297 "true" => TRUE_KW,
300 "false" => Some(FALSE_KW), 298 "false" => FALSE_KW,
301 "as" => Some(AS_KW), 299 "as" => AS_KW,
302 "extern" => Some(EXTERN_KW), 300 "extern" => EXTERN_KW,
303 "crate" => Some(CRATE_KW), 301 "crate" => CRATE_KW,
304 "mod" => Some(MOD_KW), 302 "mod" => MOD_KW,
305 "pub" => Some(PUB_KW), 303 "pub" => PUB_KW,
306 "self" => Some(SELF_KW), 304 "self" => SELF_KW,
307 "super" => Some(SUPER_KW), 305 "super" => SUPER_KW,
308 "in" => Some(IN_KW), 306 "in" => IN_KW,
309 "where" => Some(WHERE_KW), 307 "where" => WHERE_KW,
310 "for" => Some(FOR_KW), 308 "for" => FOR_KW,
311 "loop" => Some(LOOP_KW), 309 "loop" => LOOP_KW,
312 "while" => Some(WHILE_KW), 310 "while" => WHILE_KW,
313 "if" => Some(IF_KW), 311 "if" => IF_KW,
314 "match" => Some(MATCH_KW), 312 "match" => MATCH_KW,
315 "const" => Some(CONST_KW), 313 "const" => CONST_KW,
316 "static" => Some(STATIC_KW), 314 "static" => STATIC_KW,
317 "mut" => Some(MUT_KW), 315 "mut" => MUT_KW,
318 "unsafe" => Some(UNSAFE_KW), 316 "unsafe" => UNSAFE_KW,
319 "type" => Some(TYPE_KW), 317 "type" => TYPE_KW,
320 "ref" => Some(REF_KW), 318 "ref" => REF_KW,
321 "let" => Some(LET_KW), 319 "let" => LET_KW,
322 _ => None, 320 _ => return None,
323 } 321 };
322 Some(kw)
324 } 323 }
325} 324}
326 325