diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-12-16 17:08:03 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-12-16 17:08:03 +0000 |
commit | 067067a6c11bb5afda98f5af14bfdec4744e7812 (patch) | |
tree | 1c0b6c4c78ee040ebdf818dada804fce311382a6 /crates/parser | |
parent | 63bbdb31e5148c804bbf940963c9c8f3481ad258 (diff) | |
parent | dd496223f50232fe98312ee8edc89eb4b5ee3d85 (diff) |
Merge #6896
6896: Node-ify lifetimes r=jonas-schievink a=Veykril
Let's see if this passes the tests 🤞
Depends on https://github.com/rust-analyzer/ungrammar/pull/15
Co-authored-by: Jonas Schievink <[email protected]>
Co-authored-by: Jonas Schievink <[email protected]>
Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/parser')
-rw-r--r-- | crates/parser/src/grammar.rs | 7 | ||||
-rw-r--r-- | crates/parser/src/grammar/expressions/atom.rs | 16 | ||||
-rw-r--r-- | crates/parser/src/grammar/items/traits.rs | 10 | ||||
-rw-r--r-- | crates/parser/src/grammar/params.rs | 13 | ||||
-rw-r--r-- | crates/parser/src/grammar/type_args.rs | 4 | ||||
-rw-r--r-- | crates/parser/src/grammar/type_params.rs | 18 | ||||
-rw-r--r-- | crates/parser/src/grammar/types.rs | 4 | ||||
-rw-r--r-- | crates/parser/src/syntax_kind/generated.rs | 5 |
8 files changed, 48 insertions, 29 deletions
diff --git a/crates/parser/src/grammar.rs b/crates/parser/src/grammar.rs index 116b991a8..23039eba4 100644 --- a/crates/parser/src/grammar.rs +++ b/crates/parser/src/grammar.rs | |||
@@ -283,6 +283,13 @@ fn name_ref_or_index(p: &mut Parser) { | |||
283 | m.complete(p, NAME_REF); | 283 | m.complete(p, NAME_REF); |
284 | } | 284 | } |
285 | 285 | ||
286 | fn lifetime(p: &mut Parser) { | ||
287 | assert!(p.at(LIFETIME_IDENT)); | ||
288 | let m = p.start(); | ||
289 | p.bump(LIFETIME_IDENT); | ||
290 | m.complete(p, LIFETIME); | ||
291 | } | ||
292 | |||
286 | fn error_block(p: &mut Parser, message: &str) { | 293 | fn error_block(p: &mut Parser, message: &str) { |
287 | assert!(p.at(T!['{'])); | 294 | assert!(p.at(T!['{'])); |
288 | let m = p.start(); | 295 | let m = p.start(); |
diff --git a/crates/parser/src/grammar/expressions/atom.rs b/crates/parser/src/grammar/expressions/atom.rs index 31f42f161..18b63feb7 100644 --- a/crates/parser/src/grammar/expressions/atom.rs +++ b/crates/parser/src/grammar/expressions/atom.rs | |||
@@ -48,7 +48,7 @@ pub(super) const ATOM_EXPR_FIRST: TokenSet = | |||
48 | T![try], | 48 | T![try], |
49 | T![loop], | 49 | T![loop], |
50 | T![for], | 50 | T![for], |
51 | LIFETIME, | 51 | LIFETIME_IDENT, |
52 | ])); | 52 | ])); |
53 | 53 | ||
54 | const EXPR_RECOVERY_SET: TokenSet = TokenSet::new(&[LET_KW, R_DOLLAR]); | 54 | const EXPR_RECOVERY_SET: TokenSet = TokenSet::new(&[LET_KW, R_DOLLAR]); |
@@ -75,7 +75,7 @@ pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMar | |||
75 | T![for] => for_expr(p, None), | 75 | T![for] => for_expr(p, None), |
76 | T![while] => while_expr(p, None), | 76 | T![while] => while_expr(p, None), |
77 | T![try] => try_block_expr(p, None), | 77 | T![try] => try_block_expr(p, None), |
78 | LIFETIME if la == T![:] => { | 78 | LIFETIME_IDENT if la == T![:] => { |
79 | let m = p.start(); | 79 | let m = p.start(); |
80 | label(p); | 80 | label(p); |
81 | match p.current() { | 81 | match p.current() { |
@@ -275,9 +275,9 @@ fn if_expr(p: &mut Parser) -> CompletedMarker { | |||
275 | // 'c: for x in () {} | 275 | // 'c: for x in () {} |
276 | // } | 276 | // } |
277 | fn label(p: &mut Parser) { | 277 | fn label(p: &mut Parser) { |
278 | assert!(p.at(LIFETIME) && p.nth(1) == T![:]); | 278 | assert!(p.at(LIFETIME_IDENT) && p.nth(1) == T![:]); |
279 | let m = p.start(); | 279 | let m = p.start(); |
280 | p.bump(LIFETIME); | 280 | lifetime(p); |
281 | p.bump_any(); | 281 | p.bump_any(); |
282 | m.complete(p, LABEL); | 282 | m.complete(p, LABEL); |
283 | } | 283 | } |
@@ -501,7 +501,9 @@ fn continue_expr(p: &mut Parser) -> CompletedMarker { | |||
501 | assert!(p.at(T![continue])); | 501 | assert!(p.at(T![continue])); |
502 | let m = p.start(); | 502 | let m = p.start(); |
503 | p.bump(T![continue]); | 503 | p.bump(T![continue]); |
504 | p.eat(LIFETIME); | 504 | if p.at(LIFETIME_IDENT) { |
505 | lifetime(p); | ||
506 | } | ||
505 | m.complete(p, CONTINUE_EXPR) | 507 | m.complete(p, CONTINUE_EXPR) |
506 | } | 508 | } |
507 | 509 | ||
@@ -518,7 +520,9 @@ fn break_expr(p: &mut Parser, r: Restrictions) -> CompletedMarker { | |||
518 | assert!(p.at(T![break])); | 520 | assert!(p.at(T![break])); |
519 | let m = p.start(); | 521 | let m = p.start(); |
520 | p.bump(T![break]); | 522 | p.bump(T![break]); |
521 | p.eat(LIFETIME); | 523 | if p.at(LIFETIME_IDENT) { |
524 | lifetime(p); | ||
525 | } | ||
522 | // test break_ambiguity | 526 | // test break_ambiguity |
523 | // fn foo(){ | 527 | // fn foo(){ |
524 | // if break {} | 528 | // if break {} |
diff --git a/crates/parser/src/grammar/items/traits.rs b/crates/parser/src/grammar/items/traits.rs index 8394020da..ab9a12b4d 100644 --- a/crates/parser/src/grammar/items/traits.rs +++ b/crates/parser/src/grammar/items/traits.rs | |||
@@ -98,10 +98,10 @@ fn choose_type_params_over_qpath(p: &Parser) -> bool { | |||
98 | // `<` `>` - empty generic parameters | 98 | // `<` `>` - empty generic parameters |
99 | // `<` `#` - generic parameters with attributes | 99 | // `<` `#` - generic parameters with attributes |
100 | // `<` `const` - const generic parameters | 100 | // `<` `const` - const generic parameters |
101 | // `<` (LIFETIME|IDENT) `>` - single generic parameter | 101 | // `<` (LIFETIME_IDENT|IDENT) `>` - single generic parameter |
102 | // `<` (LIFETIME|IDENT) `,` - first generic parameter in a list | 102 | // `<` (LIFETIME_IDENT|IDENT) `,` - first generic parameter in a list |
103 | // `<` (LIFETIME|IDENT) `:` - generic parameter with bounds | 103 | // `<` (LIFETIME_IDENT|IDENT) `:` - generic parameter with bounds |
104 | // `<` (LIFETIME|IDENT) `=` - generic parameter with a default | 104 | // `<` (LIFETIME_IDENT|IDENT) `=` - generic parameter with a default |
105 | // The only truly ambiguous case is | 105 | // The only truly ambiguous case is |
106 | // `<` IDENT `>` `::` IDENT ... | 106 | // `<` IDENT `>` `::` IDENT ... |
107 | // we disambiguate it in favor of generics (`impl<T> ::absolute::Path<T> { ... }`) | 107 | // we disambiguate it in favor of generics (`impl<T> ::absolute::Path<T> { ... }`) |
@@ -113,7 +113,7 @@ fn choose_type_params_over_qpath(p: &Parser) -> bool { | |||
113 | if p.nth(1) == T![#] || p.nth(1) == T![>] || p.nth(1) == CONST_KW { | 113 | if p.nth(1) == T![#] || p.nth(1) == T![>] || p.nth(1) == CONST_KW { |
114 | return true; | 114 | return true; |
115 | } | 115 | } |
116 | (p.nth(1) == LIFETIME || p.nth(1) == IDENT) | 116 | (p.nth(1) == LIFETIME_IDENT || p.nth(1) == IDENT) |
117 | && (p.nth(2) == T![>] || p.nth(2) == T![,] || p.nth(2) == T![:] || p.nth(2) == T![=]) | 117 | && (p.nth(2) == T![>] || p.nth(2) == T![,] || p.nth(2) == T![:] || p.nth(2) == T![=]) |
118 | } | 118 | } |
119 | 119 | ||
diff --git a/crates/parser/src/grammar/params.rs b/crates/parser/src/grammar/params.rs index a665ffc13..3ee4e4fca 100644 --- a/crates/parser/src/grammar/params.rs +++ b/crates/parser/src/grammar/params.rs | |||
@@ -169,15 +169,20 @@ fn opt_self_param(p: &mut Parser) { | |||
169 | let la1 = p.nth(1); | 169 | let la1 = p.nth(1); |
170 | let la2 = p.nth(2); | 170 | let la2 = p.nth(2); |
171 | let la3 = p.nth(3); | 171 | let la3 = p.nth(3); |
172 | let n_toks = match (p.current(), la1, la2, la3) { | 172 | let mut n_toks = match (p.current(), la1, la2, la3) { |
173 | (T![&], T![self], _, _) => 2, | 173 | (T![&], T![self], _, _) => 2, |
174 | (T![&], T![mut], T![self], _) => 3, | 174 | (T![&], T![mut], T![self], _) => 3, |
175 | (T![&], LIFETIME, T![self], _) => 3, | 175 | (T![&], LIFETIME_IDENT, T![self], _) => 3, |
176 | (T![&], LIFETIME, T![mut], T![self]) => 4, | 176 | (T![&], LIFETIME_IDENT, T![mut], T![self]) => 4, |
177 | _ => return, | 177 | _ => return, |
178 | }; | 178 | }; |
179 | m = p.start(); | 179 | m = p.start(); |
180 | for _ in 0..n_toks { | 180 | p.bump_any(); |
181 | if p.at(LIFETIME_IDENT) { | ||
182 | lifetime(p); | ||
183 | n_toks -= 1; | ||
184 | } | ||
185 | for _ in 1..n_toks { | ||
181 | p.bump_any(); | 186 | p.bump_any(); |
182 | } | 187 | } |
183 | } | 188 | } |
diff --git a/crates/parser/src/grammar/type_args.rs b/crates/parser/src/grammar/type_args.rs index f2d34a749..a013c49b9 100644 --- a/crates/parser/src/grammar/type_args.rs +++ b/crates/parser/src/grammar/type_args.rs | |||
@@ -30,8 +30,8 @@ pub(super) fn opt_generic_arg_list(p: &mut Parser, colon_colon_required: bool) { | |||
30 | fn generic_arg(p: &mut Parser) { | 30 | fn generic_arg(p: &mut Parser) { |
31 | let m = p.start(); | 31 | let m = p.start(); |
32 | match p.current() { | 32 | match p.current() { |
33 | LIFETIME => { | 33 | LIFETIME_IDENT => { |
34 | p.bump(LIFETIME); | 34 | lifetime(p); |
35 | m.complete(p, LIFETIME_ARG); | 35 | m.complete(p, LIFETIME_ARG); |
36 | } | 36 | } |
37 | // test associated_type_bounds | 37 | // test associated_type_bounds |
diff --git a/crates/parser/src/grammar/type_params.rs b/crates/parser/src/grammar/type_params.rs index bc7d8d724..9c3f7c28a 100644 --- a/crates/parser/src/grammar/type_params.rs +++ b/crates/parser/src/grammar/type_params.rs | |||
@@ -23,7 +23,7 @@ fn generic_param_list(p: &mut Parser) { | |||
23 | attributes::outer_attrs(p); | 23 | attributes::outer_attrs(p); |
24 | 24 | ||
25 | match p.current() { | 25 | match p.current() { |
26 | LIFETIME => lifetime_param(p, m), | 26 | LIFETIME_IDENT => lifetime_param(p, m), |
27 | IDENT => type_param(p, m), | 27 | IDENT => type_param(p, m), |
28 | CONST_KW => const_param(p, m), | 28 | CONST_KW => const_param(p, m), |
29 | _ => { | 29 | _ => { |
@@ -40,8 +40,8 @@ fn generic_param_list(p: &mut Parser) { | |||
40 | } | 40 | } |
41 | 41 | ||
42 | fn lifetime_param(p: &mut Parser, m: Marker) { | 42 | fn lifetime_param(p: &mut Parser, m: Marker) { |
43 | assert!(p.at(LIFETIME)); | 43 | assert!(p.at(LIFETIME_IDENT)); |
44 | p.bump(LIFETIME); | 44 | lifetime(p); |
45 | if p.at(T![:]) { | 45 | if p.at(T![:]) { |
46 | lifetime_bounds(p); | 46 | lifetime_bounds(p); |
47 | } | 47 | } |
@@ -84,8 +84,8 @@ pub(super) fn bounds(p: &mut Parser) { | |||
84 | fn lifetime_bounds(p: &mut Parser) { | 84 | fn lifetime_bounds(p: &mut Parser) { |
85 | assert!(p.at(T![:])); | 85 | assert!(p.at(T![:])); |
86 | p.bump(T![:]); | 86 | p.bump(T![:]); |
87 | while p.at(LIFETIME) { | 87 | while p.at(LIFETIME_IDENT) { |
88 | p.bump(LIFETIME); | 88 | lifetime(p); |
89 | if !p.eat(T![+]) { | 89 | if !p.eat(T![+]) { |
90 | break; | 90 | break; |
91 | } | 91 | } |
@@ -112,7 +112,7 @@ fn type_bound(p: &mut Parser) -> bool { | |||
112 | let has_paren = p.eat(T!['(']); | 112 | let has_paren = p.eat(T!['(']); |
113 | p.eat(T![?]); | 113 | p.eat(T![?]); |
114 | match p.current() { | 114 | match p.current() { |
115 | LIFETIME => p.bump(LIFETIME), | 115 | LIFETIME_IDENT => lifetime(p), |
116 | T![for] => types::for_type(p), | 116 | T![for] => types::for_type(p), |
117 | _ if paths::is_use_path_start(p) => types::path_type_(p, false), | 117 | _ if paths::is_use_path_start(p) => types::path_type_(p, false), |
118 | _ => { | 118 | _ => { |
@@ -162,7 +162,7 @@ pub(super) fn opt_where_clause(p: &mut Parser) { | |||
162 | 162 | ||
163 | fn is_where_predicate(p: &mut Parser) -> bool { | 163 | fn is_where_predicate(p: &mut Parser) -> bool { |
164 | match p.current() { | 164 | match p.current() { |
165 | LIFETIME => true, | 165 | LIFETIME_IDENT => true, |
166 | T![impl] => false, | 166 | T![impl] => false, |
167 | token => types::TYPE_FIRST.contains(token), | 167 | token => types::TYPE_FIRST.contains(token), |
168 | } | 168 | } |
@@ -175,8 +175,8 @@ fn is_where_clause_end(p: &mut Parser) -> bool { | |||
175 | fn where_predicate(p: &mut Parser) { | 175 | fn where_predicate(p: &mut Parser) { |
176 | let m = p.start(); | 176 | let m = p.start(); |
177 | match p.current() { | 177 | match p.current() { |
178 | LIFETIME => { | 178 | LIFETIME_IDENT => { |
179 | p.bump(LIFETIME); | 179 | lifetime(p); |
180 | if p.at(T![:]) { | 180 | if p.at(T![:]) { |
181 | bounds(p); | 181 | bounds(p); |
182 | } else { | 182 | } else { |
diff --git a/crates/parser/src/grammar/types.rs b/crates/parser/src/grammar/types.rs index 1ea130ac5..36a15eace 100644 --- a/crates/parser/src/grammar/types.rs +++ b/crates/parser/src/grammar/types.rs | |||
@@ -167,7 +167,9 @@ fn ref_type(p: &mut Parser) { | |||
167 | assert!(p.at(T![&])); | 167 | assert!(p.at(T![&])); |
168 | let m = p.start(); | 168 | let m = p.start(); |
169 | p.bump(T![&]); | 169 | p.bump(T![&]); |
170 | p.eat(LIFETIME); | 170 | if p.at(LIFETIME_IDENT) { |
171 | lifetime(p); | ||
172 | } | ||
171 | p.eat(T![mut]); | 173 | p.eat(T![mut]); |
172 | type_no_bounds(p); | 174 | type_no_bounds(p); |
173 | m.complete(p, REF_TYPE); | 175 | m.complete(p, REF_TYPE); |
diff --git a/crates/parser/src/syntax_kind/generated.rs b/crates/parser/src/syntax_kind/generated.rs index 5d6ec17a4..980aa5979 100644 --- a/crates/parser/src/syntax_kind/generated.rs +++ b/crates/parser/src/syntax_kind/generated.rs | |||
@@ -116,7 +116,7 @@ pub enum SyntaxKind { | |||
116 | ERROR, | 116 | ERROR, |
117 | IDENT, | 117 | IDENT, |
118 | WHITESPACE, | 118 | WHITESPACE, |
119 | LIFETIME, | 119 | LIFETIME_IDENT, |
120 | COMMENT, | 120 | COMMENT, |
121 | SHEBANG, | 121 | SHEBANG, |
122 | L_DOLLAR, | 122 | L_DOLLAR, |
@@ -237,6 +237,7 @@ pub enum SyntaxKind { | |||
237 | TYPE_PARAM, | 237 | TYPE_PARAM, |
238 | CONST_PARAM, | 238 | CONST_PARAM, |
239 | GENERIC_ARG_LIST, | 239 | GENERIC_ARG_LIST, |
240 | LIFETIME, | ||
240 | LIFETIME_ARG, | 241 | LIFETIME_ARG, |
241 | TYPE_ARG, | 242 | TYPE_ARG, |
242 | ASSOC_TYPE_ARG, | 243 | ASSOC_TYPE_ARG, |
@@ -364,4 +365,4 @@ impl SyntaxKind { | |||
364 | } | 365 | } |
365 | } | 366 | } |
366 | #[macro_export] | 367 | #[macro_export] |
367 | macro_rules ! T { [;] => { $ crate :: SyntaxKind :: SEMICOLON } ; [,] => { $ crate :: SyntaxKind :: COMMA } ; ['('] => { $ crate :: SyntaxKind :: L_PAREN } ; [')'] => { $ crate :: SyntaxKind :: R_PAREN } ; ['{'] => { $ crate :: SyntaxKind :: L_CURLY } ; ['}'] => { $ crate :: SyntaxKind :: R_CURLY } ; ['['] => { $ crate :: SyntaxKind :: L_BRACK } ; [']'] => { $ crate :: SyntaxKind :: R_BRACK } ; [<] => { $ crate :: SyntaxKind :: L_ANGLE } ; [>] => { $ crate :: SyntaxKind :: R_ANGLE } ; [@] => { $ crate :: SyntaxKind :: AT } ; [#] => { $ crate :: SyntaxKind :: POUND } ; [~] => { $ crate :: SyntaxKind :: TILDE } ; [?] => { $ crate :: SyntaxKind :: QUESTION } ; [$] => { $ crate :: SyntaxKind :: DOLLAR } ; [&] => { $ crate :: SyntaxKind :: AMP } ; [|] => { $ crate :: SyntaxKind :: PIPE } ; [+] => { $ crate :: SyntaxKind :: PLUS } ; [*] => { $ crate :: SyntaxKind :: STAR } ; [/] => { $ crate :: SyntaxKind :: SLASH } ; [^] => { $ crate :: SyntaxKind :: CARET } ; [%] => { $ crate :: SyntaxKind :: PERCENT } ; [_] => { $ crate :: SyntaxKind :: UNDERSCORE } ; [.] => { $ crate :: SyntaxKind :: DOT } ; [..] => { $ crate :: SyntaxKind :: DOT2 } ; [...] => { $ crate :: SyntaxKind :: DOT3 } ; [..=] => { $ crate :: SyntaxKind :: DOT2EQ } ; [:] => { $ crate :: SyntaxKind :: COLON } ; [::] => { $ crate :: SyntaxKind :: COLON2 } ; [=] => { $ crate :: SyntaxKind :: EQ } ; [==] => { $ crate :: SyntaxKind :: EQ2 } ; [=>] => { $ crate :: SyntaxKind :: FAT_ARROW } ; [!] => { $ crate :: SyntaxKind :: BANG } ; [!=] => { $ crate :: SyntaxKind :: NEQ } ; [-] => { $ crate :: SyntaxKind :: MINUS } ; [->] => { $ crate :: SyntaxKind :: THIN_ARROW } ; [<=] => { $ crate :: SyntaxKind :: LTEQ } ; [>=] => { $ crate :: SyntaxKind :: GTEQ } ; [+=] => { $ crate :: SyntaxKind :: PLUSEQ } ; [-=] => { $ crate :: SyntaxKind :: MINUSEQ } ; [|=] => { $ crate :: SyntaxKind :: PIPEEQ } ; [&=] => { $ crate :: SyntaxKind :: AMPEQ } ; [^=] => { $ crate :: SyntaxKind :: CARETEQ } ; [/=] => { $ crate :: SyntaxKind :: SLASHEQ } ; [*=] => { $ crate :: SyntaxKind :: STAREQ } ; [%=] => { $ crate :: SyntaxKind :: PERCENTEQ } ; [&&] => { $ crate :: SyntaxKind :: AMP2 } ; [||] => { $ crate :: SyntaxKind :: PIPE2 } ; [<<] => { $ crate :: SyntaxKind :: SHL } ; [>>] => { $ crate :: SyntaxKind :: SHR } ; [<<=] => { $ crate :: SyntaxKind :: SHLEQ } ; [>>=] => { $ crate :: SyntaxKind :: SHREQ } ; [as] => { $ crate :: SyntaxKind :: AS_KW } ; [async] => { $ crate :: SyntaxKind :: ASYNC_KW } ; [await] => { $ crate :: SyntaxKind :: AWAIT_KW } ; [box] => { $ crate :: SyntaxKind :: BOX_KW } ; [break] => { $ crate :: SyntaxKind :: BREAK_KW } ; [const] => { $ crate :: SyntaxKind :: CONST_KW } ; [continue] => { $ crate :: SyntaxKind :: CONTINUE_KW } ; [crate] => { $ crate :: SyntaxKind :: CRATE_KW } ; [dyn] => { $ crate :: SyntaxKind :: DYN_KW } ; [else] => { $ crate :: SyntaxKind :: ELSE_KW } ; [enum] => { $ crate :: SyntaxKind :: ENUM_KW } ; [extern] => { $ crate :: SyntaxKind :: EXTERN_KW } ; [false] => { $ crate :: SyntaxKind :: FALSE_KW } ; [fn] => { $ crate :: SyntaxKind :: FN_KW } ; [for] => { $ crate :: SyntaxKind :: FOR_KW } ; [if] => { $ crate :: SyntaxKind :: IF_KW } ; [impl] => { $ crate :: SyntaxKind :: IMPL_KW } ; [in] => { $ crate :: SyntaxKind :: IN_KW } ; [let] => { $ crate :: SyntaxKind :: LET_KW } ; [loop] => { $ crate :: SyntaxKind :: LOOP_KW } ; [macro] => { $ crate :: SyntaxKind :: MACRO_KW } ; [match] => { $ crate :: SyntaxKind :: MATCH_KW } ; [mod] => { $ crate :: SyntaxKind :: MOD_KW } ; [move] => { $ crate :: SyntaxKind :: MOVE_KW } ; [mut] => { $ crate :: SyntaxKind :: MUT_KW } ; [pub] => { $ crate :: SyntaxKind :: PUB_KW } ; [ref] => { $ crate :: SyntaxKind :: REF_KW } ; [return] => { $ crate :: SyntaxKind :: RETURN_KW } ; [self] => { $ crate :: SyntaxKind :: SELF_KW } ; [static] => { $ crate :: SyntaxKind :: STATIC_KW } ; [struct] => { $ crate :: SyntaxKind :: STRUCT_KW } ; [super] => { $ crate :: SyntaxKind :: SUPER_KW } ; [trait] => { $ crate :: SyntaxKind :: TRAIT_KW } ; [true] => { $ crate :: SyntaxKind :: TRUE_KW } ; [try] => { $ crate :: SyntaxKind :: TRY_KW } ; [type] => { $ crate :: SyntaxKind :: TYPE_KW } ; [unsafe] => { $ crate :: SyntaxKind :: UNSAFE_KW } ; [use] => { $ crate :: SyntaxKind :: USE_KW } ; [where] => { $ crate :: SyntaxKind :: WHERE_KW } ; [while] => { $ crate :: SyntaxKind :: WHILE_KW } ; [auto] => { $ crate :: SyntaxKind :: AUTO_KW } ; [default] => { $ crate :: SyntaxKind :: DEFAULT_KW } ; [existential] => { $ crate :: SyntaxKind :: EXISTENTIAL_KW } ; [union] => { $ crate :: SyntaxKind :: UNION_KW } ; [raw] => { $ crate :: SyntaxKind :: RAW_KW } ; [macro_rules] => { $ crate :: SyntaxKind :: MACRO_RULES_KW } ; [lifetime] => { $ crate :: SyntaxKind :: LIFETIME } ; [ident] => { $ crate :: SyntaxKind :: IDENT } ; [shebang] => { $ crate :: SyntaxKind :: SHEBANG } ; } | 368 | macro_rules ! T { [;] => { $ crate :: SyntaxKind :: SEMICOLON } ; [,] => { $ crate :: SyntaxKind :: COMMA } ; ['('] => { $ crate :: SyntaxKind :: L_PAREN } ; [')'] => { $ crate :: SyntaxKind :: R_PAREN } ; ['{'] => { $ crate :: SyntaxKind :: L_CURLY } ; ['}'] => { $ crate :: SyntaxKind :: R_CURLY } ; ['['] => { $ crate :: SyntaxKind :: L_BRACK } ; [']'] => { $ crate :: SyntaxKind :: R_BRACK } ; [<] => { $ crate :: SyntaxKind :: L_ANGLE } ; [>] => { $ crate :: SyntaxKind :: R_ANGLE } ; [@] => { $ crate :: SyntaxKind :: AT } ; [#] => { $ crate :: SyntaxKind :: POUND } ; [~] => { $ crate :: SyntaxKind :: TILDE } ; [?] => { $ crate :: SyntaxKind :: QUESTION } ; [$] => { $ crate :: SyntaxKind :: DOLLAR } ; [&] => { $ crate :: SyntaxKind :: AMP } ; [|] => { $ crate :: SyntaxKind :: PIPE } ; [+] => { $ crate :: SyntaxKind :: PLUS } ; [*] => { $ crate :: SyntaxKind :: STAR } ; [/] => { $ crate :: SyntaxKind :: SLASH } ; [^] => { $ crate :: SyntaxKind :: CARET } ; [%] => { $ crate :: SyntaxKind :: PERCENT } ; [_] => { $ crate :: SyntaxKind :: UNDERSCORE } ; [.] => { $ crate :: SyntaxKind :: DOT } ; [..] => { $ crate :: SyntaxKind :: DOT2 } ; [...] => { $ crate :: SyntaxKind :: DOT3 } ; [..=] => { $ crate :: SyntaxKind :: DOT2EQ } ; [:] => { $ crate :: SyntaxKind :: COLON } ; [::] => { $ crate :: SyntaxKind :: COLON2 } ; [=] => { $ crate :: SyntaxKind :: EQ } ; [==] => { $ crate :: SyntaxKind :: EQ2 } ; [=>] => { $ crate :: SyntaxKind :: FAT_ARROW } ; [!] => { $ crate :: SyntaxKind :: BANG } ; [!=] => { $ crate :: SyntaxKind :: NEQ } ; [-] => { $ crate :: SyntaxKind :: MINUS } ; [->] => { $ crate :: SyntaxKind :: THIN_ARROW } ; [<=] => { $ crate :: SyntaxKind :: LTEQ } ; [>=] => { $ crate :: SyntaxKind :: GTEQ } ; [+=] => { $ crate :: SyntaxKind :: PLUSEQ } ; [-=] => { $ crate :: SyntaxKind :: MINUSEQ } ; [|=] => { $ crate :: SyntaxKind :: PIPEEQ } ; [&=] => { $ crate :: SyntaxKind :: AMPEQ } ; [^=] => { $ crate :: SyntaxKind :: CARETEQ } ; [/=] => { $ crate :: SyntaxKind :: SLASHEQ } ; [*=] => { $ crate :: SyntaxKind :: STAREQ } ; [%=] => { $ crate :: SyntaxKind :: PERCENTEQ } ; [&&] => { $ crate :: SyntaxKind :: AMP2 } ; [||] => { $ crate :: SyntaxKind :: PIPE2 } ; [<<] => { $ crate :: SyntaxKind :: SHL } ; [>>] => { $ crate :: SyntaxKind :: SHR } ; [<<=] => { $ crate :: SyntaxKind :: SHLEQ } ; [>>=] => { $ crate :: SyntaxKind :: SHREQ } ; [as] => { $ crate :: SyntaxKind :: AS_KW } ; [async] => { $ crate :: SyntaxKind :: ASYNC_KW } ; [await] => { $ crate :: SyntaxKind :: AWAIT_KW } ; [box] => { $ crate :: SyntaxKind :: BOX_KW } ; [break] => { $ crate :: SyntaxKind :: BREAK_KW } ; [const] => { $ crate :: SyntaxKind :: CONST_KW } ; [continue] => { $ crate :: SyntaxKind :: CONTINUE_KW } ; [crate] => { $ crate :: SyntaxKind :: CRATE_KW } ; [dyn] => { $ crate :: SyntaxKind :: DYN_KW } ; [else] => { $ crate :: SyntaxKind :: ELSE_KW } ; [enum] => { $ crate :: SyntaxKind :: ENUM_KW } ; [extern] => { $ crate :: SyntaxKind :: EXTERN_KW } ; [false] => { $ crate :: SyntaxKind :: FALSE_KW } ; [fn] => { $ crate :: SyntaxKind :: FN_KW } ; [for] => { $ crate :: SyntaxKind :: FOR_KW } ; [if] => { $ crate :: SyntaxKind :: IF_KW } ; [impl] => { $ crate :: SyntaxKind :: IMPL_KW } ; [in] => { $ crate :: SyntaxKind :: IN_KW } ; [let] => { $ crate :: SyntaxKind :: LET_KW } ; [loop] => { $ crate :: SyntaxKind :: LOOP_KW } ; [macro] => { $ crate :: SyntaxKind :: MACRO_KW } ; [match] => { $ crate :: SyntaxKind :: MATCH_KW } ; [mod] => { $ crate :: SyntaxKind :: MOD_KW } ; [move] => { $ crate :: SyntaxKind :: MOVE_KW } ; [mut] => { $ crate :: SyntaxKind :: MUT_KW } ; [pub] => { $ crate :: SyntaxKind :: PUB_KW } ; [ref] => { $ crate :: SyntaxKind :: REF_KW } ; [return] => { $ crate :: SyntaxKind :: RETURN_KW } ; [self] => { $ crate :: SyntaxKind :: SELF_KW } ; [static] => { $ crate :: SyntaxKind :: STATIC_KW } ; [struct] => { $ crate :: SyntaxKind :: STRUCT_KW } ; [super] => { $ crate :: SyntaxKind :: SUPER_KW } ; [trait] => { $ crate :: SyntaxKind :: TRAIT_KW } ; [true] => { $ crate :: SyntaxKind :: TRUE_KW } ; [try] => { $ crate :: SyntaxKind :: TRY_KW } ; [type] => { $ crate :: SyntaxKind :: TYPE_KW } ; [unsafe] => { $ crate :: SyntaxKind :: UNSAFE_KW } ; [use] => { $ crate :: SyntaxKind :: USE_KW } ; [where] => { $ crate :: SyntaxKind :: WHERE_KW } ; [while] => { $ crate :: SyntaxKind :: WHILE_KW } ; [auto] => { $ crate :: SyntaxKind :: AUTO_KW } ; [default] => { $ crate :: SyntaxKind :: DEFAULT_KW } ; [existential] => { $ crate :: SyntaxKind :: EXISTENTIAL_KW } ; [union] => { $ crate :: SyntaxKind :: UNION_KW } ; [raw] => { $ crate :: SyntaxKind :: RAW_KW } ; [macro_rules] => { $ crate :: SyntaxKind :: MACRO_RULES_KW } ; [lifetime_ident] => { $ crate :: SyntaxKind :: LIFETIME_IDENT } ; [ident] => { $ crate :: SyntaxKind :: IDENT } ; [shebang] => { $ crate :: SyntaxKind :: SHEBANG } ; } |