diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-08-19 10:37:03 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-08-19 10:37:03 +0100 |
commit | 53241928e5866b5aa501710e59b264905beeca1a (patch) | |
tree | 2e1533cdefd25cda25f02711632ae8e206cc68f6 /crates/ra_parser/src | |
parent | 83413cc9ef73d578f2e42c21f7aa85ef296be8c0 (diff) | |
parent | 038975b348b03dd3063d14cabd30fa71b010baea (diff) |
Merge #1697
1697: Use quote instead of tera for boilerplate generation r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_parser/src')
-rw-r--r-- | crates/ra_parser/src/syntax_kind/generated.rs | 983 | ||||
-rw-r--r-- | crates/ra_parser/src/syntax_kind/generated.rs.tera | 128 |
2 files changed, 534 insertions, 577 deletions
diff --git a/crates/ra_parser/src/syntax_kind/generated.rs b/crates/ra_parser/src/syntax_kind/generated.rs index 4b5abb516..415839cb5 100644 --- a/crates/ra_parser/src/syntax_kind/generated.rs +++ b/crates/ra_parser/src/syntax_kind/generated.rs | |||
@@ -1,16 +1,11 @@ | |||
1 | // This file is automatically generated based on the file `./generated.rs.tera` when `cargo gen-syntax` is run | 1 | // Generated file, do not edit by hand, see `crate/ra_tools/src/codegen` |
2 | // Do not edit manually | ||
3 | 2 | ||
4 | #![allow(bad_style, missing_docs, unreachable_pub)] | 3 | #![allow(bad_style, missing_docs, unreachable_pub)] |
5 | #![cfg_attr(rustfmt, rustfmt_skip)] | ||
6 | use super::SyntaxInfo; | 4 | use super::SyntaxInfo; |
7 | 5 | #[doc = r" The kind of syntax node, e.g. `IDENT`, `USE_KW`, or `STRUCT_DEF`."] | |
8 | /// The kind of syntax node, e.g. `IDENT`, `USE_KW`, or `STRUCT_DEF`. | ||
9 | #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] | 6 | #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] |
10 | #[repr(u16)] | 7 | #[repr(u16)] |
11 | pub enum SyntaxKind { | 8 | pub enum SyntaxKind { |
12 | // Technical SyntaxKinds: they appear temporally during parsing, | ||
13 | // but never end up in the final tree | ||
14 | #[doc(hidden)] | 9 | #[doc(hidden)] |
15 | TOMBSTONE, | 10 | TOMBSTONE, |
16 | #[doc(hidden)] | 11 | #[doc(hidden)] |
@@ -242,477 +237,280 @@ pub enum SyntaxKind { | |||
242 | TYPE_BOUND_LIST, | 237 | TYPE_BOUND_LIST, |
243 | MACRO_ITEMS, | 238 | MACRO_ITEMS, |
244 | MACRO_STMTS, | 239 | MACRO_STMTS, |
245 | // Technical kind so that we can cast from u16 safely | ||
246 | #[doc(hidden)] | 240 | #[doc(hidden)] |
247 | __LAST, | 241 | __LAST, |
248 | } | 242 | } |
249 | use self::SyntaxKind::*; | 243 | use self::SyntaxKind::*; |
250 | |||
251 | #[macro_export] | ||
252 | macro_rules! T { | ||
253 | (;) => { $crate::SyntaxKind::SEMI }; | ||
254 | (,) => { $crate::SyntaxKind::COMMA }; | ||
255 | ('(') => { $crate::SyntaxKind::L_PAREN }; | ||
256 | (')') => { $crate::SyntaxKind::R_PAREN }; | ||
257 | ('{') => { $crate::SyntaxKind::L_CURLY }; | ||
258 | ('}') => { $crate::SyntaxKind::R_CURLY }; | ||
259 | ('[') => { $crate::SyntaxKind::L_BRACK }; | ||
260 | (']') => { $crate::SyntaxKind::R_BRACK }; | ||
261 | (<) => { $crate::SyntaxKind::L_ANGLE }; | ||
262 | (>) => { $crate::SyntaxKind::R_ANGLE }; | ||
263 | (@) => { $crate::SyntaxKind::AT }; | ||
264 | (#) => { $crate::SyntaxKind::POUND }; | ||
265 | (~) => { $crate::SyntaxKind::TILDE }; | ||
266 | (?) => { $crate::SyntaxKind::QUESTION }; | ||
267 | ($) => { $crate::SyntaxKind::DOLLAR }; | ||
268 | (&) => { $crate::SyntaxKind::AMP }; | ||
269 | (|) => { $crate::SyntaxKind::PIPE }; | ||
270 | (+) => { $crate::SyntaxKind::PLUS }; | ||
271 | (*) => { $crate::SyntaxKind::STAR }; | ||
272 | (/) => { $crate::SyntaxKind::SLASH }; | ||
273 | (^) => { $crate::SyntaxKind::CARET }; | ||
274 | (%) => { $crate::SyntaxKind::PERCENT }; | ||
275 | (_) => { $crate::SyntaxKind::UNDERSCORE }; | ||
276 | (.) => { $crate::SyntaxKind::DOT }; | ||
277 | (..) => { $crate::SyntaxKind::DOTDOT }; | ||
278 | (...) => { $crate::SyntaxKind::DOTDOTDOT }; | ||
279 | (..=) => { $crate::SyntaxKind::DOTDOTEQ }; | ||
280 | (:) => { $crate::SyntaxKind::COLON }; | ||
281 | (::) => { $crate::SyntaxKind::COLONCOLON }; | ||
282 | (=) => { $crate::SyntaxKind::EQ }; | ||
283 | (==) => { $crate::SyntaxKind::EQEQ }; | ||
284 | (=>) => { $crate::SyntaxKind::FAT_ARROW }; | ||
285 | (!) => { $crate::SyntaxKind::EXCL }; | ||
286 | (!=) => { $crate::SyntaxKind::NEQ }; | ||
287 | (-) => { $crate::SyntaxKind::MINUS }; | ||
288 | (->) => { $crate::SyntaxKind::THIN_ARROW }; | ||
289 | (<=) => { $crate::SyntaxKind::LTEQ }; | ||
290 | (>=) => { $crate::SyntaxKind::GTEQ }; | ||
291 | (+=) => { $crate::SyntaxKind::PLUSEQ }; | ||
292 | (-=) => { $crate::SyntaxKind::MINUSEQ }; | ||
293 | (|=) => { $crate::SyntaxKind::PIPEEQ }; | ||
294 | (&=) => { $crate::SyntaxKind::AMPEQ }; | ||
295 | (^=) => { $crate::SyntaxKind::CARETEQ }; | ||
296 | (/=) => { $crate::SyntaxKind::SLASHEQ }; | ||
297 | (*=) => { $crate::SyntaxKind::STAREQ }; | ||
298 | (%=) => { $crate::SyntaxKind::PERCENTEQ }; | ||
299 | (&&) => { $crate::SyntaxKind::AMPAMP }; | ||
300 | (||) => { $crate::SyntaxKind::PIPEPIPE }; | ||
301 | (<<) => { $crate::SyntaxKind::SHL }; | ||
302 | (>>) => { $crate::SyntaxKind::SHR }; | ||
303 | (<<=) => { $crate::SyntaxKind::SHLEQ }; | ||
304 | (>>=) => { $crate::SyntaxKind::SHREQ }; | ||
305 | (async) => { $crate::SyntaxKind::ASYNC_KW }; | ||
306 | (use) => { $crate::SyntaxKind::USE_KW }; | ||
307 | (fn) => { $crate::SyntaxKind::FN_KW }; | ||
308 | (struct) => { $crate::SyntaxKind::STRUCT_KW }; | ||
309 | (enum) => { $crate::SyntaxKind::ENUM_KW }; | ||
310 | (trait) => { $crate::SyntaxKind::TRAIT_KW }; | ||
311 | (impl) => { $crate::SyntaxKind::IMPL_KW }; | ||
312 | (dyn) => { $crate::SyntaxKind::DYN_KW }; | ||
313 | (true) => { $crate::SyntaxKind::TRUE_KW }; | ||
314 | (false) => { $crate::SyntaxKind::FALSE_KW }; | ||
315 | (as) => { $crate::SyntaxKind::AS_KW }; | ||
316 | (extern) => { $crate::SyntaxKind::EXTERN_KW }; | ||
317 | (crate) => { $crate::SyntaxKind::CRATE_KW }; | ||
318 | (mod) => { $crate::SyntaxKind::MOD_KW }; | ||
319 | (pub) => { $crate::SyntaxKind::PUB_KW }; | ||
320 | (self) => { $crate::SyntaxKind::SELF_KW }; | ||
321 | (super) => { $crate::SyntaxKind::SUPER_KW }; | ||
322 | (in) => { $crate::SyntaxKind::IN_KW }; | ||
323 | (where) => { $crate::SyntaxKind::WHERE_KW }; | ||
324 | (for) => { $crate::SyntaxKind::FOR_KW }; | ||
325 | (loop) => { $crate::SyntaxKind::LOOP_KW }; | ||
326 | (while) => { $crate::SyntaxKind::WHILE_KW }; | ||
327 | (continue) => { $crate::SyntaxKind::CONTINUE_KW }; | ||
328 | (break) => { $crate::SyntaxKind::BREAK_KW }; | ||
329 | (if) => { $crate::SyntaxKind::IF_KW }; | ||
330 | (else) => { $crate::SyntaxKind::ELSE_KW }; | ||
331 | (match) => { $crate::SyntaxKind::MATCH_KW }; | ||
332 | (const) => { $crate::SyntaxKind::CONST_KW }; | ||
333 | (static) => { $crate::SyntaxKind::STATIC_KW }; | ||
334 | (mut) => { $crate::SyntaxKind::MUT_KW }; | ||
335 | (unsafe) => { $crate::SyntaxKind::UNSAFE_KW }; | ||
336 | (type) => { $crate::SyntaxKind::TYPE_KW }; | ||
337 | (ref) => { $crate::SyntaxKind::REF_KW }; | ||
338 | (let) => { $crate::SyntaxKind::LET_KW }; | ||
339 | (move) => { $crate::SyntaxKind::MOVE_KW }; | ||
340 | (return) => { $crate::SyntaxKind::RETURN_KW }; | ||
341 | (try) => { $crate::SyntaxKind::TRY_KW }; | ||
342 | (box) => { $crate::SyntaxKind::BOX_KW }; | ||
343 | (await) => { $crate::SyntaxKind::AWAIT_KW }; | ||
344 | (auto) => { $crate::SyntaxKind::AUTO_KW }; | ||
345 | (default) => { $crate::SyntaxKind::DEFAULT_KW }; | ||
346 | (existential) => { $crate::SyntaxKind::EXISTENTIAL_KW }; | ||
347 | (union) => { $crate::SyntaxKind::UNION_KW }; | ||
348 | } | ||
349 | |||
350 | impl From<u16> for SyntaxKind { | 244 | impl From<u16> for SyntaxKind { |
351 | fn from(d: u16) -> SyntaxKind { | 245 | fn from(d: u16) -> SyntaxKind { |
352 | assert!(d <= (__LAST as u16)); | 246 | assert!(d <= (__LAST as u16)); |
353 | unsafe { std::mem::transmute::<u16, SyntaxKind>(d) } | 247 | unsafe { std::mem::transmute::<u16, SyntaxKind>(d) } |
354 | } | 248 | } |
355 | } | 249 | } |
356 | |||
357 | impl From<SyntaxKind> for u16 { | 250 | impl From<SyntaxKind> for u16 { |
358 | fn from(k: SyntaxKind) -> u16 { | 251 | fn from(k: SyntaxKind) -> u16 { |
359 | k as u16 | 252 | k as u16 |
360 | } | 253 | } |
361 | } | 254 | } |
362 | |||
363 | impl SyntaxKind { | 255 | impl SyntaxKind { |
364 | pub fn is_keyword(self) -> bool { | 256 | pub fn is_keyword(self) -> bool { |
365 | match self { | 257 | match self { |
366 | | ASYNC_KW | 258 | ASYNC_KW | USE_KW | FN_KW | STRUCT_KW | ENUM_KW | TRAIT_KW | IMPL_KW | DYN_KW |
367 | | USE_KW | 259 | | TRUE_KW | FALSE_KW | AS_KW | EXTERN_KW | CRATE_KW | MOD_KW | PUB_KW | SELF_KW |
368 | | FN_KW | 260 | | SUPER_KW | IN_KW | WHERE_KW | FOR_KW | LOOP_KW | WHILE_KW | CONTINUE_KW |
369 | | STRUCT_KW | 261 | | BREAK_KW | IF_KW | ELSE_KW | MATCH_KW | CONST_KW | STATIC_KW | MUT_KW | UNSAFE_KW |
370 | | ENUM_KW | 262 | | TYPE_KW | REF_KW | LET_KW | MOVE_KW | RETURN_KW | TRY_KW | BOX_KW | AWAIT_KW |
371 | | TRAIT_KW | 263 | | AUTO_KW | DEFAULT_KW | EXISTENTIAL_KW | UNION_KW => true, |
372 | | IMPL_KW | 264 | _ => false, |
373 | | DYN_KW | ||
374 | | TRUE_KW | ||
375 | | FALSE_KW | ||
376 | | AS_KW | ||
377 | | EXTERN_KW | ||
378 | | CRATE_KW | ||
379 | | MOD_KW | ||
380 | | PUB_KW | ||
381 | | SELF_KW | ||
382 | | SUPER_KW | ||
383 | | IN_KW | ||
384 | | WHERE_KW | ||
385 | | FOR_KW | ||
386 | | LOOP_KW | ||
387 | | WHILE_KW | ||
388 | | CONTINUE_KW | ||
389 | | BREAK_KW | ||
390 | | IF_KW | ||
391 | | ELSE_KW | ||
392 | | MATCH_KW | ||
393 | | CONST_KW | ||
394 | | STATIC_KW | ||
395 | | MUT_KW | ||
396 | | UNSAFE_KW | ||
397 | | TYPE_KW | ||
398 | | REF_KW | ||
399 | | LET_KW | ||
400 | | MOVE_KW | ||
401 | | RETURN_KW | ||
402 | | TRY_KW | ||
403 | | BOX_KW | ||
404 | | AWAIT_KW | ||
405 | | AUTO_KW | ||
406 | | DEFAULT_KW | ||
407 | | EXISTENTIAL_KW | ||
408 | | UNION_KW | ||
409 | => true, | ||
410 | _ => false | ||
411 | } | 265 | } |
412 | } | 266 | } |
413 | |||
414 | pub fn is_punct(self) -> bool { | 267 | pub fn is_punct(self) -> bool { |
415 | match self { | 268 | match self { |
416 | | SEMI | 269 | SEMI | COMMA | L_PAREN | R_PAREN | L_CURLY | R_CURLY | L_BRACK | R_BRACK | L_ANGLE |
417 | | COMMA | 270 | | R_ANGLE | AT | POUND | TILDE | QUESTION | DOLLAR | AMP | PIPE | PLUS | STAR |
418 | | L_PAREN | 271 | | SLASH | CARET | PERCENT | UNDERSCORE | DOT | DOTDOT | DOTDOTDOT | DOTDOTEQ |
419 | | R_PAREN | 272 | | COLON | COLONCOLON | EQ | EQEQ | FAT_ARROW | EXCL | NEQ | MINUS | THIN_ARROW |
420 | | L_CURLY | 273 | | LTEQ | GTEQ | PLUSEQ | MINUSEQ | PIPEEQ | AMPEQ | CARETEQ | SLASHEQ | STAREQ |
421 | | R_CURLY | 274 | | PERCENTEQ | AMPAMP | PIPEPIPE | SHL | SHR | SHLEQ | SHREQ => true, |
422 | | L_BRACK | 275 | _ => false, |
423 | | R_BRACK | ||
424 | | L_ANGLE | ||
425 | | R_ANGLE | ||
426 | | AT | ||
427 | | POUND | ||
428 | | TILDE | ||
429 | | QUESTION | ||
430 | | DOLLAR | ||
431 | | AMP | ||
432 | | PIPE | ||
433 | | PLUS | ||
434 | | STAR | ||
435 | | SLASH | ||
436 | | CARET | ||
437 | | PERCENT | ||
438 | | UNDERSCORE | ||
439 | | DOT | ||
440 | | DOTDOT | ||
441 | | DOTDOTDOT | ||
442 | | DOTDOTEQ | ||
443 | | COLON | ||
444 | | COLONCOLON | ||
445 | | EQ | ||
446 | | EQEQ | ||
447 | | FAT_ARROW | ||
448 | | EXCL | ||
449 | | NEQ | ||
450 | | MINUS | ||
451 | | THIN_ARROW | ||
452 | | LTEQ | ||
453 | | GTEQ | ||
454 | | PLUSEQ | ||
455 | | MINUSEQ | ||
456 | | PIPEEQ | ||
457 | | AMPEQ | ||
458 | | CARETEQ | ||
459 | | SLASHEQ | ||
460 | | STAREQ | ||
461 | | PERCENTEQ | ||
462 | | AMPAMP | ||
463 | | PIPEPIPE | ||
464 | | SHL | ||
465 | | SHR | ||
466 | | SHLEQ | ||
467 | | SHREQ | ||
468 | => true, | ||
469 | _ => false | ||
470 | } | 276 | } |
471 | } | 277 | } |
472 | pub fn is_literal(self) -> bool { | 278 | pub fn is_literal(self) -> bool { |
473 | match self { | 279 | match self { |
474 | | INT_NUMBER | 280 | INT_NUMBER | FLOAT_NUMBER | CHAR | BYTE | STRING | RAW_STRING | BYTE_STRING |
475 | | FLOAT_NUMBER | 281 | | RAW_BYTE_STRING => true, |
476 | | CHAR | 282 | _ => false, |
477 | | BYTE | ||
478 | | STRING | ||
479 | | RAW_STRING | ||
480 | | BYTE_STRING | ||
481 | | RAW_BYTE_STRING | ||
482 | => true, | ||
483 | _ => false | ||
484 | } | 283 | } |
485 | } | 284 | } |
486 | |||
487 | pub(crate) fn info(self) -> &'static SyntaxInfo { | 285 | pub(crate) fn info(self) -> &'static SyntaxInfo { |
488 | match self { | 286 | match self { |
489 | SEMI => &SyntaxInfo { name: "SEMI" }, | 287 | SEMI => &SyntaxInfo { name: stringify!(SEMI) }, |
490 | COMMA => &SyntaxInfo { name: "COMMA" }, | 288 | COMMA => &SyntaxInfo { name: stringify!(COMMA) }, |
491 | L_PAREN => &SyntaxInfo { name: "L_PAREN" }, | 289 | L_PAREN => &SyntaxInfo { name: stringify!(L_PAREN) }, |
492 | R_PAREN => &SyntaxInfo { name: "R_PAREN" }, | 290 | R_PAREN => &SyntaxInfo { name: stringify!(R_PAREN) }, |
493 | L_CURLY => &SyntaxInfo { name: "L_CURLY" }, | 291 | L_CURLY => &SyntaxInfo { name: stringify!(L_CURLY) }, |
494 | R_CURLY => &SyntaxInfo { name: "R_CURLY" }, | 292 | R_CURLY => &SyntaxInfo { name: stringify!(R_CURLY) }, |
495 | L_BRACK => &SyntaxInfo { name: "L_BRACK" }, | 293 | L_BRACK => &SyntaxInfo { name: stringify!(L_BRACK) }, |
496 | R_BRACK => &SyntaxInfo { name: "R_BRACK" }, | 294 | R_BRACK => &SyntaxInfo { name: stringify!(R_BRACK) }, |
497 | L_ANGLE => &SyntaxInfo { name: "L_ANGLE" }, | 295 | L_ANGLE => &SyntaxInfo { name: stringify!(L_ANGLE) }, |
498 | R_ANGLE => &SyntaxInfo { name: "R_ANGLE" }, | 296 | R_ANGLE => &SyntaxInfo { name: stringify!(R_ANGLE) }, |
499 | AT => &SyntaxInfo { name: "AT" }, | 297 | AT => &SyntaxInfo { name: stringify!(AT) }, |
500 | POUND => &SyntaxInfo { name: "POUND" }, | 298 | POUND => &SyntaxInfo { name: stringify!(POUND) }, |
501 | TILDE => &SyntaxInfo { name: "TILDE" }, | 299 | TILDE => &SyntaxInfo { name: stringify!(TILDE) }, |
502 | QUESTION => &SyntaxInfo { name: "QUESTION" }, | 300 | QUESTION => &SyntaxInfo { name: stringify!(QUESTION) }, |
503 | DOLLAR => &SyntaxInfo { name: "DOLLAR" }, | 301 | DOLLAR => &SyntaxInfo { name: stringify!(DOLLAR) }, |
504 | AMP => &SyntaxInfo { name: "AMP" }, | 302 | AMP => &SyntaxInfo { name: stringify!(AMP) }, |
505 | PIPE => &SyntaxInfo { name: "PIPE" }, | 303 | PIPE => &SyntaxInfo { name: stringify!(PIPE) }, |
506 | PLUS => &SyntaxInfo { name: "PLUS" }, | 304 | PLUS => &SyntaxInfo { name: stringify!(PLUS) }, |
507 | STAR => &SyntaxInfo { name: "STAR" }, | 305 | STAR => &SyntaxInfo { name: stringify!(STAR) }, |
508 | SLASH => &SyntaxInfo { name: "SLASH" }, | 306 | SLASH => &SyntaxInfo { name: stringify!(SLASH) }, |
509 | CARET => &SyntaxInfo { name: "CARET" }, | 307 | CARET => &SyntaxInfo { name: stringify!(CARET) }, |
510 | PERCENT => &SyntaxInfo { name: "PERCENT" }, | 308 | PERCENT => &SyntaxInfo { name: stringify!(PERCENT) }, |
511 | UNDERSCORE => &SyntaxInfo { name: "UNDERSCORE" }, | 309 | UNDERSCORE => &SyntaxInfo { name: stringify!(UNDERSCORE) }, |
512 | DOT => &SyntaxInfo { name: "DOT" }, | 310 | DOT => &SyntaxInfo { name: stringify!(DOT) }, |
513 | DOTDOT => &SyntaxInfo { name: "DOTDOT" }, | 311 | DOTDOT => &SyntaxInfo { name: stringify!(DOTDOT) }, |
514 | DOTDOTDOT => &SyntaxInfo { name: "DOTDOTDOT" }, | 312 | DOTDOTDOT => &SyntaxInfo { name: stringify!(DOTDOTDOT) }, |
515 | DOTDOTEQ => &SyntaxInfo { name: "DOTDOTEQ" }, | 313 | DOTDOTEQ => &SyntaxInfo { name: stringify!(DOTDOTEQ) }, |
516 | COLON => &SyntaxInfo { name: "COLON" }, | 314 | COLON => &SyntaxInfo { name: stringify!(COLON) }, |
517 | COLONCOLON => &SyntaxInfo { name: "COLONCOLON" }, | 315 | COLONCOLON => &SyntaxInfo { name: stringify!(COLONCOLON) }, |
518 | EQ => &SyntaxInfo { name: "EQ" }, | 316 | EQ => &SyntaxInfo { name: stringify!(EQ) }, |
519 | EQEQ => &SyntaxInfo { name: "EQEQ" }, | 317 | EQEQ => &SyntaxInfo { name: stringify!(EQEQ) }, |
520 | FAT_ARROW => &SyntaxInfo { name: "FAT_ARROW" }, | 318 | FAT_ARROW => &SyntaxInfo { name: stringify!(FAT_ARROW) }, |
521 | EXCL => &SyntaxInfo { name: "EXCL" }, | 319 | EXCL => &SyntaxInfo { name: stringify!(EXCL) }, |
522 | NEQ => &SyntaxInfo { name: "NEQ" }, | 320 | NEQ => &SyntaxInfo { name: stringify!(NEQ) }, |
523 | MINUS => &SyntaxInfo { name: "MINUS" }, | 321 | MINUS => &SyntaxInfo { name: stringify!(MINUS) }, |
524 | THIN_ARROW => &SyntaxInfo { name: "THIN_ARROW" }, | 322 | THIN_ARROW => &SyntaxInfo { name: stringify!(THIN_ARROW) }, |
525 | LTEQ => &SyntaxInfo { name: "LTEQ" }, | 323 | LTEQ => &SyntaxInfo { name: stringify!(LTEQ) }, |
526 | GTEQ => &SyntaxInfo { name: "GTEQ" }, | 324 | GTEQ => &SyntaxInfo { name: stringify!(GTEQ) }, |
527 | PLUSEQ => &SyntaxInfo { name: "PLUSEQ" }, | 325 | PLUSEQ => &SyntaxInfo { name: stringify!(PLUSEQ) }, |
528 | MINUSEQ => &SyntaxInfo { name: "MINUSEQ" }, | 326 | MINUSEQ => &SyntaxInfo { name: stringify!(MINUSEQ) }, |
529 | PIPEEQ => &SyntaxInfo { name: "PIPEEQ" }, | 327 | PIPEEQ => &SyntaxInfo { name: stringify!(PIPEEQ) }, |
530 | AMPEQ => &SyntaxInfo { name: "AMPEQ" }, | 328 | AMPEQ => &SyntaxInfo { name: stringify!(AMPEQ) }, |
531 | CARETEQ => &SyntaxInfo { name: "CARETEQ" }, | 329 | CARETEQ => &SyntaxInfo { name: stringify!(CARETEQ) }, |
532 | SLASHEQ => &SyntaxInfo { name: "SLASHEQ" }, | 330 | SLASHEQ => &SyntaxInfo { name: stringify!(SLASHEQ) }, |
533 | STAREQ => &SyntaxInfo { name: "STAREQ" }, | 331 | STAREQ => &SyntaxInfo { name: stringify!(STAREQ) }, |
534 | PERCENTEQ => &SyntaxInfo { name: "PERCENTEQ" }, | 332 | PERCENTEQ => &SyntaxInfo { name: stringify!(PERCENTEQ) }, |
535 | AMPAMP => &SyntaxInfo { name: "AMPAMP" }, | 333 | AMPAMP => &SyntaxInfo { name: stringify!(AMPAMP) }, |
536 | PIPEPIPE => &SyntaxInfo { name: "PIPEPIPE" }, | 334 | PIPEPIPE => &SyntaxInfo { name: stringify!(PIPEPIPE) }, |
537 | SHL => &SyntaxInfo { name: "SHL" }, | 335 | SHL => &SyntaxInfo { name: stringify!(SHL) }, |
538 | SHR => &SyntaxInfo { name: "SHR" }, | 336 | SHR => &SyntaxInfo { name: stringify!(SHR) }, |
539 | SHLEQ => &SyntaxInfo { name: "SHLEQ" }, | 337 | SHLEQ => &SyntaxInfo { name: stringify!(SHLEQ) }, |
540 | SHREQ => &SyntaxInfo { name: "SHREQ" }, | 338 | SHREQ => &SyntaxInfo { name: stringify!(SHREQ) }, |
541 | ASYNC_KW => &SyntaxInfo { name: "ASYNC_KW" }, | 339 | ASYNC_KW => &SyntaxInfo { name: stringify!(ASYNC_KW) }, |
542 | USE_KW => &SyntaxInfo { name: "USE_KW" }, | 340 | USE_KW => &SyntaxInfo { name: stringify!(USE_KW) }, |
543 | FN_KW => &SyntaxInfo { name: "FN_KW" }, | 341 | FN_KW => &SyntaxInfo { name: stringify!(FN_KW) }, |
544 | STRUCT_KW => &SyntaxInfo { name: "STRUCT_KW" }, | 342 | STRUCT_KW => &SyntaxInfo { name: stringify!(STRUCT_KW) }, |
545 | ENUM_KW => &SyntaxInfo { name: "ENUM_KW" }, | 343 | ENUM_KW => &SyntaxInfo { name: stringify!(ENUM_KW) }, |
546 | TRAIT_KW => &SyntaxInfo { name: "TRAIT_KW" }, | 344 | TRAIT_KW => &SyntaxInfo { name: stringify!(TRAIT_KW) }, |
547 | IMPL_KW => &SyntaxInfo { name: "IMPL_KW" }, | 345 | IMPL_KW => &SyntaxInfo { name: stringify!(IMPL_KW) }, |
548 | DYN_KW => &SyntaxInfo { name: "DYN_KW" }, | 346 | DYN_KW => &SyntaxInfo { name: stringify!(DYN_KW) }, |
549 | TRUE_KW => &SyntaxInfo { name: "TRUE_KW" }, | 347 | TRUE_KW => &SyntaxInfo { name: stringify!(TRUE_KW) }, |
550 | FALSE_KW => &SyntaxInfo { name: "FALSE_KW" }, | 348 | FALSE_KW => &SyntaxInfo { name: stringify!(FALSE_KW) }, |
551 | AS_KW => &SyntaxInfo { name: "AS_KW" }, | 349 | AS_KW => &SyntaxInfo { name: stringify!(AS_KW) }, |
552 | EXTERN_KW => &SyntaxInfo { name: "EXTERN_KW" }, | 350 | EXTERN_KW => &SyntaxInfo { name: stringify!(EXTERN_KW) }, |
553 | CRATE_KW => &SyntaxInfo { name: "CRATE_KW" }, | 351 | CRATE_KW => &SyntaxInfo { name: stringify!(CRATE_KW) }, |
554 | MOD_KW => &SyntaxInfo { name: "MOD_KW" }, | 352 | MOD_KW => &SyntaxInfo { name: stringify!(MOD_KW) }, |
555 | PUB_KW => &SyntaxInfo { name: "PUB_KW" }, | 353 | PUB_KW => &SyntaxInfo { name: stringify!(PUB_KW) }, |
556 | SELF_KW => &SyntaxInfo { name: "SELF_KW" }, | 354 | SELF_KW => &SyntaxInfo { name: stringify!(SELF_KW) }, |
557 | SUPER_KW => &SyntaxInfo { name: "SUPER_KW" }, | 355 | SUPER_KW => &SyntaxInfo { name: stringify!(SUPER_KW) }, |
558 | IN_KW => &SyntaxInfo { name: "IN_KW" }, | 356 | IN_KW => &SyntaxInfo { name: stringify!(IN_KW) }, |
559 | WHERE_KW => &SyntaxInfo { name: "WHERE_KW" }, | 357 | WHERE_KW => &SyntaxInfo { name: stringify!(WHERE_KW) }, |
560 | FOR_KW => &SyntaxInfo { name: "FOR_KW" }, | 358 | FOR_KW => &SyntaxInfo { name: stringify!(FOR_KW) }, |
561 | LOOP_KW => &SyntaxInfo { name: "LOOP_KW" }, | 359 | LOOP_KW => &SyntaxInfo { name: stringify!(LOOP_KW) }, |
562 | WHILE_KW => &SyntaxInfo { name: "WHILE_KW" }, | 360 | WHILE_KW => &SyntaxInfo { name: stringify!(WHILE_KW) }, |
563 | CONTINUE_KW => &SyntaxInfo { name: "CONTINUE_KW" }, | 361 | CONTINUE_KW => &SyntaxInfo { name: stringify!(CONTINUE_KW) }, |
564 | BREAK_KW => &SyntaxInfo { name: "BREAK_KW" }, | 362 | BREAK_KW => &SyntaxInfo { name: stringify!(BREAK_KW) }, |
565 | IF_KW => &SyntaxInfo { name: "IF_KW" }, | 363 | IF_KW => &SyntaxInfo { name: stringify!(IF_KW) }, |
566 | ELSE_KW => &SyntaxInfo { name: "ELSE_KW" }, | 364 | ELSE_KW => &SyntaxInfo { name: stringify!(ELSE_KW) }, |
567 | MATCH_KW => &SyntaxInfo { name: "MATCH_KW" }, | 365 | MATCH_KW => &SyntaxInfo { name: stringify!(MATCH_KW) }, |
568 | CONST_KW => &SyntaxInfo { name: "CONST_KW" }, | 366 | CONST_KW => &SyntaxInfo { name: stringify!(CONST_KW) }, |
569 | STATIC_KW => &SyntaxInfo { name: "STATIC_KW" }, | 367 | STATIC_KW => &SyntaxInfo { name: stringify!(STATIC_KW) }, |
570 | MUT_KW => &SyntaxInfo { name: "MUT_KW" }, | 368 | MUT_KW => &SyntaxInfo { name: stringify!(MUT_KW) }, |
571 | UNSAFE_KW => &SyntaxInfo { name: "UNSAFE_KW" }, | 369 | UNSAFE_KW => &SyntaxInfo { name: stringify!(UNSAFE_KW) }, |
572 | TYPE_KW => &SyntaxInfo { name: "TYPE_KW" }, | 370 | TYPE_KW => &SyntaxInfo { name: stringify!(TYPE_KW) }, |
573 | REF_KW => &SyntaxInfo { name: "REF_KW" }, | 371 | REF_KW => &SyntaxInfo { name: stringify!(REF_KW) }, |
574 | LET_KW => &SyntaxInfo { name: "LET_KW" }, | 372 | LET_KW => &SyntaxInfo { name: stringify!(LET_KW) }, |
575 | MOVE_KW => &SyntaxInfo { name: "MOVE_KW" }, | 373 | MOVE_KW => &SyntaxInfo { name: stringify!(MOVE_KW) }, |
576 | RETURN_KW => &SyntaxInfo { name: "RETURN_KW" }, | 374 | RETURN_KW => &SyntaxInfo { name: stringify!(RETURN_KW) }, |
577 | TRY_KW => &SyntaxInfo { name: "TRY_KW" }, | 375 | TRY_KW => &SyntaxInfo { name: stringify!(TRY_KW) }, |
578 | BOX_KW => &SyntaxInfo { name: "BOX_KW" }, | 376 | BOX_KW => &SyntaxInfo { name: stringify!(BOX_KW) }, |
579 | AWAIT_KW => &SyntaxInfo { name: "AWAIT_KW" }, | 377 | AWAIT_KW => &SyntaxInfo { name: stringify!(AWAIT_KW) }, |
580 | AUTO_KW => &SyntaxInfo { name: "AUTO_KW" }, | 378 | AUTO_KW => &SyntaxInfo { name: stringify!(AUTO_KW) }, |
581 | DEFAULT_KW => &SyntaxInfo { name: "DEFAULT_KW" }, | 379 | DEFAULT_KW => &SyntaxInfo { name: stringify!(DEFAULT_KW) }, |
582 | EXISTENTIAL_KW => &SyntaxInfo { name: "EXISTENTIAL_KW" }, | 380 | EXISTENTIAL_KW => &SyntaxInfo { name: stringify!(EXISTENTIAL_KW) }, |
583 | UNION_KW => &SyntaxInfo { name: "UNION_KW" }, | 381 | UNION_KW => &SyntaxInfo { name: stringify!(UNION_KW) }, |
584 | INT_NUMBER => &SyntaxInfo { name: "INT_NUMBER" }, | 382 | INT_NUMBER => &SyntaxInfo { name: stringify!(INT_NUMBER) }, |
585 | FLOAT_NUMBER => &SyntaxInfo { name: "FLOAT_NUMBER" }, | 383 | FLOAT_NUMBER => &SyntaxInfo { name: stringify!(FLOAT_NUMBER) }, |
586 | CHAR => &SyntaxInfo { name: "CHAR" }, | 384 | CHAR => &SyntaxInfo { name: stringify!(CHAR) }, |
587 | BYTE => &SyntaxInfo { name: "BYTE" }, | 385 | BYTE => &SyntaxInfo { name: stringify!(BYTE) }, |
588 | STRING => &SyntaxInfo { name: "STRING" }, | 386 | STRING => &SyntaxInfo { name: stringify!(STRING) }, |
589 | RAW_STRING => &SyntaxInfo { name: "RAW_STRING" }, | 387 | RAW_STRING => &SyntaxInfo { name: stringify!(RAW_STRING) }, |
590 | BYTE_STRING => &SyntaxInfo { name: "BYTE_STRING" }, | 388 | BYTE_STRING => &SyntaxInfo { name: stringify!(BYTE_STRING) }, |
591 | RAW_BYTE_STRING => &SyntaxInfo { name: "RAW_BYTE_STRING" }, | 389 | RAW_BYTE_STRING => &SyntaxInfo { name: stringify!(RAW_BYTE_STRING) }, |
592 | ERROR => &SyntaxInfo { name: "ERROR" }, | 390 | ERROR => &SyntaxInfo { name: stringify!(ERROR) }, |
593 | IDENT => &SyntaxInfo { name: "IDENT" }, | 391 | IDENT => &SyntaxInfo { name: stringify!(IDENT) }, |
594 | WHITESPACE => &SyntaxInfo { name: "WHITESPACE" }, | 392 | WHITESPACE => &SyntaxInfo { name: stringify!(WHITESPACE) }, |
595 | LIFETIME => &SyntaxInfo { name: "LIFETIME" }, | 393 | LIFETIME => &SyntaxInfo { name: stringify!(LIFETIME) }, |
596 | COMMENT => &SyntaxInfo { name: "COMMENT" }, | 394 | COMMENT => &SyntaxInfo { name: stringify!(COMMENT) }, |
597 | SHEBANG => &SyntaxInfo { name: "SHEBANG" }, | 395 | SHEBANG => &SyntaxInfo { name: stringify!(SHEBANG) }, |
598 | L_DOLLAR => &SyntaxInfo { name: "L_DOLLAR" }, | 396 | L_DOLLAR => &SyntaxInfo { name: stringify!(L_DOLLAR) }, |
599 | R_DOLLAR => &SyntaxInfo { name: "R_DOLLAR" }, | 397 | R_DOLLAR => &SyntaxInfo { name: stringify!(R_DOLLAR) }, |
600 | SOURCE_FILE => &SyntaxInfo { name: "SOURCE_FILE" }, | 398 | SOURCE_FILE => &SyntaxInfo { name: stringify!(SOURCE_FILE) }, |
601 | STRUCT_DEF => &SyntaxInfo { name: "STRUCT_DEF" }, | 399 | STRUCT_DEF => &SyntaxInfo { name: stringify!(STRUCT_DEF) }, |
602 | ENUM_DEF => &SyntaxInfo { name: "ENUM_DEF" }, | 400 | ENUM_DEF => &SyntaxInfo { name: stringify!(ENUM_DEF) }, |
603 | FN_DEF => &SyntaxInfo { name: "FN_DEF" }, | 401 | FN_DEF => &SyntaxInfo { name: stringify!(FN_DEF) }, |
604 | RET_TYPE => &SyntaxInfo { name: "RET_TYPE" }, | 402 | RET_TYPE => &SyntaxInfo { name: stringify!(RET_TYPE) }, |
605 | EXTERN_CRATE_ITEM => &SyntaxInfo { name: "EXTERN_CRATE_ITEM" }, | 403 | EXTERN_CRATE_ITEM => &SyntaxInfo { name: stringify!(EXTERN_CRATE_ITEM) }, |
606 | MODULE => &SyntaxInfo { name: "MODULE" }, | 404 | MODULE => &SyntaxInfo { name: stringify!(MODULE) }, |
607 | USE_ITEM => &SyntaxInfo { name: "USE_ITEM" }, | 405 | USE_ITEM => &SyntaxInfo { name: stringify!(USE_ITEM) }, |
608 | STATIC_DEF => &SyntaxInfo { name: "STATIC_DEF" }, | 406 | STATIC_DEF => &SyntaxInfo { name: stringify!(STATIC_DEF) }, |
609 | CONST_DEF => &SyntaxInfo { name: "CONST_DEF" }, | 407 | CONST_DEF => &SyntaxInfo { name: stringify!(CONST_DEF) }, |
610 | TRAIT_DEF => &SyntaxInfo { name: "TRAIT_DEF" }, | 408 | TRAIT_DEF => &SyntaxInfo { name: stringify!(TRAIT_DEF) }, |
611 | IMPL_BLOCK => &SyntaxInfo { name: "IMPL_BLOCK" }, | 409 | IMPL_BLOCK => &SyntaxInfo { name: stringify!(IMPL_BLOCK) }, |
612 | TYPE_ALIAS_DEF => &SyntaxInfo { name: "TYPE_ALIAS_DEF" }, | 410 | TYPE_ALIAS_DEF => &SyntaxInfo { name: stringify!(TYPE_ALIAS_DEF) }, |
613 | MACRO_CALL => &SyntaxInfo { name: "MACRO_CALL" }, | 411 | MACRO_CALL => &SyntaxInfo { name: stringify!(MACRO_CALL) }, |
614 | TOKEN_TREE => &SyntaxInfo { name: "TOKEN_TREE" }, | 412 | TOKEN_TREE => &SyntaxInfo { name: stringify!(TOKEN_TREE) }, |
615 | PAREN_TYPE => &SyntaxInfo { name: "PAREN_TYPE" }, | 413 | PAREN_TYPE => &SyntaxInfo { name: stringify!(PAREN_TYPE) }, |
616 | TUPLE_TYPE => &SyntaxInfo { name: "TUPLE_TYPE" }, | 414 | TUPLE_TYPE => &SyntaxInfo { name: stringify!(TUPLE_TYPE) }, |
617 | NEVER_TYPE => &SyntaxInfo { name: "NEVER_TYPE" }, | 415 | NEVER_TYPE => &SyntaxInfo { name: stringify!(NEVER_TYPE) }, |
618 | PATH_TYPE => &SyntaxInfo { name: "PATH_TYPE" }, | 416 | PATH_TYPE => &SyntaxInfo { name: stringify!(PATH_TYPE) }, |
619 | POINTER_TYPE => &SyntaxInfo { name: "POINTER_TYPE" }, | 417 | POINTER_TYPE => &SyntaxInfo { name: stringify!(POINTER_TYPE) }, |
620 | ARRAY_TYPE => &SyntaxInfo { name: "ARRAY_TYPE" }, | 418 | ARRAY_TYPE => &SyntaxInfo { name: stringify!(ARRAY_TYPE) }, |
621 | SLICE_TYPE => &SyntaxInfo { name: "SLICE_TYPE" }, | 419 | SLICE_TYPE => &SyntaxInfo { name: stringify!(SLICE_TYPE) }, |
622 | REFERENCE_TYPE => &SyntaxInfo { name: "REFERENCE_TYPE" }, | 420 | REFERENCE_TYPE => &SyntaxInfo { name: stringify!(REFERENCE_TYPE) }, |
623 | PLACEHOLDER_TYPE => &SyntaxInfo { name: "PLACEHOLDER_TYPE" }, | 421 | PLACEHOLDER_TYPE => &SyntaxInfo { name: stringify!(PLACEHOLDER_TYPE) }, |
624 | FN_POINTER_TYPE => &SyntaxInfo { name: "FN_POINTER_TYPE" }, | 422 | FN_POINTER_TYPE => &SyntaxInfo { name: stringify!(FN_POINTER_TYPE) }, |
625 | FOR_TYPE => &SyntaxInfo { name: "FOR_TYPE" }, | 423 | FOR_TYPE => &SyntaxInfo { name: stringify!(FOR_TYPE) }, |
626 | IMPL_TRAIT_TYPE => &SyntaxInfo { name: "IMPL_TRAIT_TYPE" }, | 424 | IMPL_TRAIT_TYPE => &SyntaxInfo { name: stringify!(IMPL_TRAIT_TYPE) }, |
627 | DYN_TRAIT_TYPE => &SyntaxInfo { name: "DYN_TRAIT_TYPE" }, | 425 | DYN_TRAIT_TYPE => &SyntaxInfo { name: stringify!(DYN_TRAIT_TYPE) }, |
628 | REF_PAT => &SyntaxInfo { name: "REF_PAT" }, | 426 | REF_PAT => &SyntaxInfo { name: stringify!(REF_PAT) }, |
629 | BIND_PAT => &SyntaxInfo { name: "BIND_PAT" }, | 427 | BIND_PAT => &SyntaxInfo { name: stringify!(BIND_PAT) }, |
630 | PLACEHOLDER_PAT => &SyntaxInfo { name: "PLACEHOLDER_PAT" }, | 428 | PLACEHOLDER_PAT => &SyntaxInfo { name: stringify!(PLACEHOLDER_PAT) }, |
631 | PATH_PAT => &SyntaxInfo { name: "PATH_PAT" }, | 429 | PATH_PAT => &SyntaxInfo { name: stringify!(PATH_PAT) }, |
632 | STRUCT_PAT => &SyntaxInfo { name: "STRUCT_PAT" }, | 430 | STRUCT_PAT => &SyntaxInfo { name: stringify!(STRUCT_PAT) }, |
633 | FIELD_PAT_LIST => &SyntaxInfo { name: "FIELD_PAT_LIST" }, | 431 | FIELD_PAT_LIST => &SyntaxInfo { name: stringify!(FIELD_PAT_LIST) }, |
634 | FIELD_PAT => &SyntaxInfo { name: "FIELD_PAT" }, | 432 | FIELD_PAT => &SyntaxInfo { name: stringify!(FIELD_PAT) }, |
635 | TUPLE_STRUCT_PAT => &SyntaxInfo { name: "TUPLE_STRUCT_PAT" }, | 433 | TUPLE_STRUCT_PAT => &SyntaxInfo { name: stringify!(TUPLE_STRUCT_PAT) }, |
636 | TUPLE_PAT => &SyntaxInfo { name: "TUPLE_PAT" }, | 434 | TUPLE_PAT => &SyntaxInfo { name: stringify!(TUPLE_PAT) }, |
637 | SLICE_PAT => &SyntaxInfo { name: "SLICE_PAT" }, | 435 | SLICE_PAT => &SyntaxInfo { name: stringify!(SLICE_PAT) }, |
638 | RANGE_PAT => &SyntaxInfo { name: "RANGE_PAT" }, | 436 | RANGE_PAT => &SyntaxInfo { name: stringify!(RANGE_PAT) }, |
639 | LITERAL_PAT => &SyntaxInfo { name: "LITERAL_PAT" }, | 437 | LITERAL_PAT => &SyntaxInfo { name: stringify!(LITERAL_PAT) }, |
640 | TUPLE_EXPR => &SyntaxInfo { name: "TUPLE_EXPR" }, | 438 | TUPLE_EXPR => &SyntaxInfo { name: stringify!(TUPLE_EXPR) }, |
641 | ARRAY_EXPR => &SyntaxInfo { name: "ARRAY_EXPR" }, | 439 | ARRAY_EXPR => &SyntaxInfo { name: stringify!(ARRAY_EXPR) }, |
642 | PAREN_EXPR => &SyntaxInfo { name: "PAREN_EXPR" }, | 440 | PAREN_EXPR => &SyntaxInfo { name: stringify!(PAREN_EXPR) }, |
643 | PATH_EXPR => &SyntaxInfo { name: "PATH_EXPR" }, | 441 | PATH_EXPR => &SyntaxInfo { name: stringify!(PATH_EXPR) }, |
644 | LAMBDA_EXPR => &SyntaxInfo { name: "LAMBDA_EXPR" }, | 442 | LAMBDA_EXPR => &SyntaxInfo { name: stringify!(LAMBDA_EXPR) }, |
645 | IF_EXPR => &SyntaxInfo { name: "IF_EXPR" }, | 443 | IF_EXPR => &SyntaxInfo { name: stringify!(IF_EXPR) }, |
646 | WHILE_EXPR => &SyntaxInfo { name: "WHILE_EXPR" }, | 444 | WHILE_EXPR => &SyntaxInfo { name: stringify!(WHILE_EXPR) }, |
647 | CONDITION => &SyntaxInfo { name: "CONDITION" }, | 445 | CONDITION => &SyntaxInfo { name: stringify!(CONDITION) }, |
648 | LOOP_EXPR => &SyntaxInfo { name: "LOOP_EXPR" }, | 446 | LOOP_EXPR => &SyntaxInfo { name: stringify!(LOOP_EXPR) }, |
649 | FOR_EXPR => &SyntaxInfo { name: "FOR_EXPR" }, | 447 | FOR_EXPR => &SyntaxInfo { name: stringify!(FOR_EXPR) }, |
650 | CONTINUE_EXPR => &SyntaxInfo { name: "CONTINUE_EXPR" }, | 448 | CONTINUE_EXPR => &SyntaxInfo { name: stringify!(CONTINUE_EXPR) }, |
651 | BREAK_EXPR => &SyntaxInfo { name: "BREAK_EXPR" }, | 449 | BREAK_EXPR => &SyntaxInfo { name: stringify!(BREAK_EXPR) }, |
652 | LABEL => &SyntaxInfo { name: "LABEL" }, | 450 | LABEL => &SyntaxInfo { name: stringify!(LABEL) }, |
653 | BLOCK_EXPR => &SyntaxInfo { name: "BLOCK_EXPR" }, | 451 | BLOCK_EXPR => &SyntaxInfo { name: stringify!(BLOCK_EXPR) }, |
654 | RETURN_EXPR => &SyntaxInfo { name: "RETURN_EXPR" }, | 452 | RETURN_EXPR => &SyntaxInfo { name: stringify!(RETURN_EXPR) }, |
655 | MATCH_EXPR => &SyntaxInfo { name: "MATCH_EXPR" }, | 453 | MATCH_EXPR => &SyntaxInfo { name: stringify!(MATCH_EXPR) }, |
656 | MATCH_ARM_LIST => &SyntaxInfo { name: "MATCH_ARM_LIST" }, | 454 | MATCH_ARM_LIST => &SyntaxInfo { name: stringify!(MATCH_ARM_LIST) }, |
657 | MATCH_ARM => &SyntaxInfo { name: "MATCH_ARM" }, | 455 | MATCH_ARM => &SyntaxInfo { name: stringify!(MATCH_ARM) }, |
658 | MATCH_GUARD => &SyntaxInfo { name: "MATCH_GUARD" }, | 456 | MATCH_GUARD => &SyntaxInfo { name: stringify!(MATCH_GUARD) }, |
659 | STRUCT_LIT => &SyntaxInfo { name: "STRUCT_LIT" }, | 457 | STRUCT_LIT => &SyntaxInfo { name: stringify!(STRUCT_LIT) }, |
660 | NAMED_FIELD_LIST => &SyntaxInfo { name: "NAMED_FIELD_LIST" }, | 458 | NAMED_FIELD_LIST => &SyntaxInfo { name: stringify!(NAMED_FIELD_LIST) }, |
661 | NAMED_FIELD => &SyntaxInfo { name: "NAMED_FIELD" }, | 459 | NAMED_FIELD => &SyntaxInfo { name: stringify!(NAMED_FIELD) }, |
662 | TRY_BLOCK_EXPR => &SyntaxInfo { name: "TRY_BLOCK_EXPR" }, | 460 | TRY_BLOCK_EXPR => &SyntaxInfo { name: stringify!(TRY_BLOCK_EXPR) }, |
663 | BOX_EXPR => &SyntaxInfo { name: "BOX_EXPR" }, | 461 | BOX_EXPR => &SyntaxInfo { name: stringify!(BOX_EXPR) }, |
664 | CALL_EXPR => &SyntaxInfo { name: "CALL_EXPR" }, | 462 | CALL_EXPR => &SyntaxInfo { name: stringify!(CALL_EXPR) }, |
665 | INDEX_EXPR => &SyntaxInfo { name: "INDEX_EXPR" }, | 463 | INDEX_EXPR => &SyntaxInfo { name: stringify!(INDEX_EXPR) }, |
666 | METHOD_CALL_EXPR => &SyntaxInfo { name: "METHOD_CALL_EXPR" }, | 464 | METHOD_CALL_EXPR => &SyntaxInfo { name: stringify!(METHOD_CALL_EXPR) }, |
667 | FIELD_EXPR => &SyntaxInfo { name: "FIELD_EXPR" }, | 465 | FIELD_EXPR => &SyntaxInfo { name: stringify!(FIELD_EXPR) }, |
668 | AWAIT_EXPR => &SyntaxInfo { name: "AWAIT_EXPR" }, | 466 | AWAIT_EXPR => &SyntaxInfo { name: stringify!(AWAIT_EXPR) }, |
669 | TRY_EXPR => &SyntaxInfo { name: "TRY_EXPR" }, | 467 | TRY_EXPR => &SyntaxInfo { name: stringify!(TRY_EXPR) }, |
670 | CAST_EXPR => &SyntaxInfo { name: "CAST_EXPR" }, | 468 | CAST_EXPR => &SyntaxInfo { name: stringify!(CAST_EXPR) }, |
671 | REF_EXPR => &SyntaxInfo { name: "REF_EXPR" }, | 469 | REF_EXPR => &SyntaxInfo { name: stringify!(REF_EXPR) }, |
672 | PREFIX_EXPR => &SyntaxInfo { name: "PREFIX_EXPR" }, | 470 | PREFIX_EXPR => &SyntaxInfo { name: stringify!(PREFIX_EXPR) }, |
673 | RANGE_EXPR => &SyntaxInfo { name: "RANGE_EXPR" }, | 471 | RANGE_EXPR => &SyntaxInfo { name: stringify!(RANGE_EXPR) }, |
674 | BIN_EXPR => &SyntaxInfo { name: "BIN_EXPR" }, | 472 | BIN_EXPR => &SyntaxInfo { name: stringify!(BIN_EXPR) }, |
675 | BLOCK => &SyntaxInfo { name: "BLOCK" }, | 473 | BLOCK => &SyntaxInfo { name: stringify!(BLOCK) }, |
676 | EXTERN_BLOCK => &SyntaxInfo { name: "EXTERN_BLOCK" }, | 474 | EXTERN_BLOCK => &SyntaxInfo { name: stringify!(EXTERN_BLOCK) }, |
677 | EXTERN_ITEM_LIST => &SyntaxInfo { name: "EXTERN_ITEM_LIST" }, | 475 | EXTERN_ITEM_LIST => &SyntaxInfo { name: stringify!(EXTERN_ITEM_LIST) }, |
678 | ENUM_VARIANT => &SyntaxInfo { name: "ENUM_VARIANT" }, | 476 | ENUM_VARIANT => &SyntaxInfo { name: stringify!(ENUM_VARIANT) }, |
679 | NAMED_FIELD_DEF_LIST => &SyntaxInfo { name: "NAMED_FIELD_DEF_LIST" }, | 477 | NAMED_FIELD_DEF_LIST => &SyntaxInfo { name: stringify!(NAMED_FIELD_DEF_LIST) }, |
680 | NAMED_FIELD_DEF => &SyntaxInfo { name: "NAMED_FIELD_DEF" }, | 478 | NAMED_FIELD_DEF => &SyntaxInfo { name: stringify!(NAMED_FIELD_DEF) }, |
681 | POS_FIELD_DEF_LIST => &SyntaxInfo { name: "POS_FIELD_DEF_LIST" }, | 479 | POS_FIELD_DEF_LIST => &SyntaxInfo { name: stringify!(POS_FIELD_DEF_LIST) }, |
682 | POS_FIELD_DEF => &SyntaxInfo { name: "POS_FIELD_DEF" }, | 480 | POS_FIELD_DEF => &SyntaxInfo { name: stringify!(POS_FIELD_DEF) }, |
683 | ENUM_VARIANT_LIST => &SyntaxInfo { name: "ENUM_VARIANT_LIST" }, | 481 | ENUM_VARIANT_LIST => &SyntaxInfo { name: stringify!(ENUM_VARIANT_LIST) }, |
684 | ITEM_LIST => &SyntaxInfo { name: "ITEM_LIST" }, | 482 | ITEM_LIST => &SyntaxInfo { name: stringify!(ITEM_LIST) }, |
685 | ATTR => &SyntaxInfo { name: "ATTR" }, | 483 | ATTR => &SyntaxInfo { name: stringify!(ATTR) }, |
686 | META_ITEM => &SyntaxInfo { name: "META_ITEM" }, | 484 | META_ITEM => &SyntaxInfo { name: stringify!(META_ITEM) }, |
687 | USE_TREE => &SyntaxInfo { name: "USE_TREE" }, | 485 | USE_TREE => &SyntaxInfo { name: stringify!(USE_TREE) }, |
688 | USE_TREE_LIST => &SyntaxInfo { name: "USE_TREE_LIST" }, | 486 | USE_TREE_LIST => &SyntaxInfo { name: stringify!(USE_TREE_LIST) }, |
689 | PATH => &SyntaxInfo { name: "PATH" }, | 487 | PATH => &SyntaxInfo { name: stringify!(PATH) }, |
690 | PATH_SEGMENT => &SyntaxInfo { name: "PATH_SEGMENT" }, | 488 | PATH_SEGMENT => &SyntaxInfo { name: stringify!(PATH_SEGMENT) }, |
691 | LITERAL => &SyntaxInfo { name: "LITERAL" }, | 489 | LITERAL => &SyntaxInfo { name: stringify!(LITERAL) }, |
692 | ALIAS => &SyntaxInfo { name: "ALIAS" }, | 490 | ALIAS => &SyntaxInfo { name: stringify!(ALIAS) }, |
693 | VISIBILITY => &SyntaxInfo { name: "VISIBILITY" }, | 491 | VISIBILITY => &SyntaxInfo { name: stringify!(VISIBILITY) }, |
694 | WHERE_CLAUSE => &SyntaxInfo { name: "WHERE_CLAUSE" }, | 492 | WHERE_CLAUSE => &SyntaxInfo { name: stringify!(WHERE_CLAUSE) }, |
695 | WHERE_PRED => &SyntaxInfo { name: "WHERE_PRED" }, | 493 | WHERE_PRED => &SyntaxInfo { name: stringify!(WHERE_PRED) }, |
696 | ABI => &SyntaxInfo { name: "ABI" }, | 494 | ABI => &SyntaxInfo { name: stringify!(ABI) }, |
697 | NAME => &SyntaxInfo { name: "NAME" }, | 495 | NAME => &SyntaxInfo { name: stringify!(NAME) }, |
698 | NAME_REF => &SyntaxInfo { name: "NAME_REF" }, | 496 | NAME_REF => &SyntaxInfo { name: stringify!(NAME_REF) }, |
699 | LET_STMT => &SyntaxInfo { name: "LET_STMT" }, | 497 | LET_STMT => &SyntaxInfo { name: stringify!(LET_STMT) }, |
700 | EXPR_STMT => &SyntaxInfo { name: "EXPR_STMT" }, | 498 | EXPR_STMT => &SyntaxInfo { name: stringify!(EXPR_STMT) }, |
701 | TYPE_PARAM_LIST => &SyntaxInfo { name: "TYPE_PARAM_LIST" }, | 499 | TYPE_PARAM_LIST => &SyntaxInfo { name: stringify!(TYPE_PARAM_LIST) }, |
702 | LIFETIME_PARAM => &SyntaxInfo { name: "LIFETIME_PARAM" }, | 500 | LIFETIME_PARAM => &SyntaxInfo { name: stringify!(LIFETIME_PARAM) }, |
703 | TYPE_PARAM => &SyntaxInfo { name: "TYPE_PARAM" }, | 501 | TYPE_PARAM => &SyntaxInfo { name: stringify!(TYPE_PARAM) }, |
704 | TYPE_ARG_LIST => &SyntaxInfo { name: "TYPE_ARG_LIST" }, | 502 | TYPE_ARG_LIST => &SyntaxInfo { name: stringify!(TYPE_ARG_LIST) }, |
705 | LIFETIME_ARG => &SyntaxInfo { name: "LIFETIME_ARG" }, | 503 | LIFETIME_ARG => &SyntaxInfo { name: stringify!(LIFETIME_ARG) }, |
706 | TYPE_ARG => &SyntaxInfo { name: "TYPE_ARG" }, | 504 | TYPE_ARG => &SyntaxInfo { name: stringify!(TYPE_ARG) }, |
707 | ASSOC_TYPE_ARG => &SyntaxInfo { name: "ASSOC_TYPE_ARG" }, | 505 | ASSOC_TYPE_ARG => &SyntaxInfo { name: stringify!(ASSOC_TYPE_ARG) }, |
708 | PARAM_LIST => &SyntaxInfo { name: "PARAM_LIST" }, | 506 | PARAM_LIST => &SyntaxInfo { name: stringify!(PARAM_LIST) }, |
709 | PARAM => &SyntaxInfo { name: "PARAM" }, | 507 | PARAM => &SyntaxInfo { name: stringify!(PARAM) }, |
710 | SELF_PARAM => &SyntaxInfo { name: "SELF_PARAM" }, | 508 | SELF_PARAM => &SyntaxInfo { name: stringify!(SELF_PARAM) }, |
711 | ARG_LIST => &SyntaxInfo { name: "ARG_LIST" }, | 509 | ARG_LIST => &SyntaxInfo { name: stringify!(ARG_LIST) }, |
712 | TYPE_BOUND => &SyntaxInfo { name: "TYPE_BOUND" }, | 510 | TYPE_BOUND => &SyntaxInfo { name: stringify!(TYPE_BOUND) }, |
713 | TYPE_BOUND_LIST => &SyntaxInfo { name: "TYPE_BOUND_LIST" }, | 511 | TYPE_BOUND_LIST => &SyntaxInfo { name: stringify!(TYPE_BOUND_LIST) }, |
714 | MACRO_ITEMS => &SyntaxInfo { name: "MACRO_ITEMS" }, | 512 | MACRO_ITEMS => &SyntaxInfo { name: stringify!(MACRO_ITEMS) }, |
715 | MACRO_STMTS => &SyntaxInfo { name: "MACRO_STMTS" }, | 513 | MACRO_STMTS => &SyntaxInfo { name: stringify!(MACRO_STMTS) }, |
716 | TOMBSTONE => &SyntaxInfo { name: "TOMBSTONE" }, | 514 | TOMBSTONE => &SyntaxInfo { name: "TOMBSTONE" }, |
717 | EOF => &SyntaxInfo { name: "EOF" }, | 515 | EOF => &SyntaxInfo { name: "EOF" }, |
718 | __LAST => &SyntaxInfo { name: "__LAST" }, | 516 | __LAST => &SyntaxInfo { name: "__LAST" }, |
@@ -763,7 +561,6 @@ impl SyntaxKind { | |||
763 | }; | 561 | }; |
764 | Some(kw) | 562 | Some(kw) |
765 | } | 563 | } |
766 | |||
767 | pub fn from_char(c: char) -> Option<SyntaxKind> { | 564 | pub fn from_char(c: char) -> Option<SyntaxKind> { |
768 | let tok = match c { | 565 | let tok = match c { |
769 | ';' => SEMI, | 566 | ';' => SEMI, |
@@ -794,3 +591,291 @@ impl SyntaxKind { | |||
794 | Some(tok) | 591 | Some(tok) |
795 | } | 592 | } |
796 | } | 593 | } |
594 | #[macro_export] | ||
595 | macro_rules! T { | ||
596 | ( ; ) => { | ||
597 | $crate::SyntaxKind::SEMI | ||
598 | }; | ||
599 | ( , ) => { | ||
600 | $crate::SyntaxKind::COMMA | ||
601 | }; | ||
602 | ( '(' ) => { | ||
603 | $crate::SyntaxKind::L_PAREN | ||
604 | }; | ||
605 | ( ')' ) => { | ||
606 | $crate::SyntaxKind::R_PAREN | ||
607 | }; | ||
608 | ( '{' ) => { | ||
609 | $crate::SyntaxKind::L_CURLY | ||
610 | }; | ||
611 | ( '}' ) => { | ||
612 | $crate::SyntaxKind::R_CURLY | ||
613 | }; | ||
614 | ( '[' ) => { | ||
615 | $crate::SyntaxKind::L_BRACK | ||
616 | }; | ||
617 | ( ']' ) => { | ||
618 | $crate::SyntaxKind::R_BRACK | ||
619 | }; | ||
620 | ( < ) => { | ||
621 | $crate::SyntaxKind::L_ANGLE | ||
622 | }; | ||
623 | ( > ) => { | ||
624 | $crate::SyntaxKind::R_ANGLE | ||
625 | }; | ||
626 | ( @ ) => { | ||
627 | $crate::SyntaxKind::AT | ||
628 | }; | ||
629 | ( # ) => { | ||
630 | $crate::SyntaxKind::POUND | ||
631 | }; | ||
632 | ( ~ ) => { | ||
633 | $crate::SyntaxKind::TILDE | ||
634 | }; | ||
635 | ( ? ) => { | ||
636 | $crate::SyntaxKind::QUESTION | ||
637 | }; | ||
638 | ( $ ) => { | ||
639 | $crate::SyntaxKind::DOLLAR | ||
640 | }; | ||
641 | ( & ) => { | ||
642 | $crate::SyntaxKind::AMP | ||
643 | }; | ||
644 | ( | ) => { | ||
645 | $crate::SyntaxKind::PIPE | ||
646 | }; | ||
647 | ( + ) => { | ||
648 | $crate::SyntaxKind::PLUS | ||
649 | }; | ||
650 | ( * ) => { | ||
651 | $crate::SyntaxKind::STAR | ||
652 | }; | ||
653 | ( / ) => { | ||
654 | $crate::SyntaxKind::SLASH | ||
655 | }; | ||
656 | ( ^ ) => { | ||
657 | $crate::SyntaxKind::CARET | ||
658 | }; | ||
659 | ( % ) => { | ||
660 | $crate::SyntaxKind::PERCENT | ||
661 | }; | ||
662 | ( _ ) => { | ||
663 | $crate::SyntaxKind::UNDERSCORE | ||
664 | }; | ||
665 | ( . ) => { | ||
666 | $crate::SyntaxKind::DOT | ||
667 | }; | ||
668 | ( .. ) => { | ||
669 | $crate::SyntaxKind::DOTDOT | ||
670 | }; | ||
671 | ( ... ) => { | ||
672 | $crate::SyntaxKind::DOTDOTDOT | ||
673 | }; | ||
674 | ( ..= ) => { | ||
675 | $crate::SyntaxKind::DOTDOTEQ | ||
676 | }; | ||
677 | ( : ) => { | ||
678 | $crate::SyntaxKind::COLON | ||
679 | }; | ||
680 | ( :: ) => { | ||
681 | $crate::SyntaxKind::COLONCOLON | ||
682 | }; | ||
683 | ( = ) => { | ||
684 | $crate::SyntaxKind::EQ | ||
685 | }; | ||
686 | ( == ) => { | ||
687 | $crate::SyntaxKind::EQEQ | ||
688 | }; | ||
689 | ( => ) => { | ||
690 | $crate::SyntaxKind::FAT_ARROW | ||
691 | }; | ||
692 | ( ! ) => { | ||
693 | $crate::SyntaxKind::EXCL | ||
694 | }; | ||
695 | ( != ) => { | ||
696 | $crate::SyntaxKind::NEQ | ||
697 | }; | ||
698 | ( - ) => { | ||
699 | $crate::SyntaxKind::MINUS | ||
700 | }; | ||
701 | ( -> ) => { | ||
702 | $crate::SyntaxKind::THIN_ARROW | ||
703 | }; | ||
704 | ( <= ) => { | ||
705 | $crate::SyntaxKind::LTEQ | ||
706 | }; | ||
707 | ( >= ) => { | ||
708 | $crate::SyntaxKind::GTEQ | ||
709 | }; | ||
710 | ( += ) => { | ||
711 | $crate::SyntaxKind::PLUSEQ | ||
712 | }; | ||
713 | ( -= ) => { | ||
714 | $crate::SyntaxKind::MINUSEQ | ||
715 | }; | ||
716 | ( |= ) => { | ||
717 | $crate::SyntaxKind::PIPEEQ | ||
718 | }; | ||
719 | ( &= ) => { | ||
720 | $crate::SyntaxKind::AMPEQ | ||
721 | }; | ||
722 | ( ^= ) => { | ||
723 | $crate::SyntaxKind::CARETEQ | ||
724 | }; | ||
725 | ( /= ) => { | ||
726 | $crate::SyntaxKind::SLASHEQ | ||
727 | }; | ||
728 | ( *= ) => { | ||
729 | $crate::SyntaxKind::STAREQ | ||
730 | }; | ||
731 | ( %= ) => { | ||
732 | $crate::SyntaxKind::PERCENTEQ | ||
733 | }; | ||
734 | ( && ) => { | ||
735 | $crate::SyntaxKind::AMPAMP | ||
736 | }; | ||
737 | ( || ) => { | ||
738 | $crate::SyntaxKind::PIPEPIPE | ||
739 | }; | ||
740 | ( << ) => { | ||
741 | $crate::SyntaxKind::SHL | ||
742 | }; | ||
743 | ( >> ) => { | ||
744 | $crate::SyntaxKind::SHR | ||
745 | }; | ||
746 | ( <<= ) => { | ||
747 | $crate::SyntaxKind::SHLEQ | ||
748 | }; | ||
749 | ( >>= ) => { | ||
750 | $crate::SyntaxKind::SHREQ | ||
751 | }; | ||
752 | ( async ) => { | ||
753 | $crate::SyntaxKind::ASYNC_KW | ||
754 | }; | ||
755 | ( use ) => { | ||
756 | $crate::SyntaxKind::USE_KW | ||
757 | }; | ||
758 | ( fn ) => { | ||
759 | $crate::SyntaxKind::FN_KW | ||
760 | }; | ||
761 | ( struct ) => { | ||
762 | $crate::SyntaxKind::STRUCT_KW | ||
763 | }; | ||
764 | ( enum ) => { | ||
765 | $crate::SyntaxKind::ENUM_KW | ||
766 | }; | ||
767 | ( trait ) => { | ||
768 | $crate::SyntaxKind::TRAIT_KW | ||
769 | }; | ||
770 | ( impl ) => { | ||
771 | $crate::SyntaxKind::IMPL_KW | ||
772 | }; | ||
773 | ( dyn ) => { | ||
774 | $crate::SyntaxKind::DYN_KW | ||
775 | }; | ||
776 | ( true ) => { | ||
777 | $crate::SyntaxKind::TRUE_KW | ||
778 | }; | ||
779 | ( false ) => { | ||
780 | $crate::SyntaxKind::FALSE_KW | ||
781 | }; | ||
782 | ( as ) => { | ||
783 | $crate::SyntaxKind::AS_KW | ||
784 | }; | ||
785 | ( extern ) => { | ||
786 | $crate::SyntaxKind::EXTERN_KW | ||
787 | }; | ||
788 | ( crate ) => { | ||
789 | $crate::SyntaxKind::CRATE_KW | ||
790 | }; | ||
791 | ( mod ) => { | ||
792 | $crate::SyntaxKind::MOD_KW | ||
793 | }; | ||
794 | ( pub ) => { | ||
795 | $crate::SyntaxKind::PUB_KW | ||
796 | }; | ||
797 | ( self ) => { | ||
798 | $crate::SyntaxKind::SELF_KW | ||
799 | }; | ||
800 | ( super ) => { | ||
801 | $crate::SyntaxKind::SUPER_KW | ||
802 | }; | ||
803 | ( in ) => { | ||
804 | $crate::SyntaxKind::IN_KW | ||
805 | }; | ||
806 | ( where ) => { | ||
807 | $crate::SyntaxKind::WHERE_KW | ||
808 | }; | ||
809 | ( for ) => { | ||
810 | $crate::SyntaxKind::FOR_KW | ||
811 | }; | ||
812 | ( loop ) => { | ||
813 | $crate::SyntaxKind::LOOP_KW | ||
814 | }; | ||
815 | ( while ) => { | ||
816 | $crate::SyntaxKind::WHILE_KW | ||
817 | }; | ||
818 | ( continue ) => { | ||
819 | $crate::SyntaxKind::CONTINUE_KW | ||
820 | }; | ||
821 | ( break ) => { | ||
822 | $crate::SyntaxKind::BREAK_KW | ||
823 | }; | ||
824 | ( if ) => { | ||
825 | $crate::SyntaxKind::IF_KW | ||
826 | }; | ||
827 | ( else ) => { | ||
828 | $crate::SyntaxKind::ELSE_KW | ||
829 | }; | ||
830 | ( match ) => { | ||
831 | $crate::SyntaxKind::MATCH_KW | ||
832 | }; | ||
833 | ( const ) => { | ||
834 | $crate::SyntaxKind::CONST_KW | ||
835 | }; | ||
836 | ( static ) => { | ||
837 | $crate::SyntaxKind::STATIC_KW | ||
838 | }; | ||
839 | ( mut ) => { | ||
840 | $crate::SyntaxKind::MUT_KW | ||
841 | }; | ||
842 | ( unsafe ) => { | ||
843 | $crate::SyntaxKind::UNSAFE_KW | ||
844 | }; | ||
845 | ( type ) => { | ||
846 | $crate::SyntaxKind::TYPE_KW | ||
847 | }; | ||
848 | ( ref ) => { | ||
849 | $crate::SyntaxKind::REF_KW | ||
850 | }; | ||
851 | ( let ) => { | ||
852 | $crate::SyntaxKind::LET_KW | ||
853 | }; | ||
854 | ( move ) => { | ||
855 | $crate::SyntaxKind::MOVE_KW | ||
856 | }; | ||
857 | ( return ) => { | ||
858 | $crate::SyntaxKind::RETURN_KW | ||
859 | }; | ||
860 | ( try ) => { | ||
861 | $crate::SyntaxKind::TRY_KW | ||
862 | }; | ||
863 | ( box ) => { | ||
864 | $crate::SyntaxKind::BOX_KW | ||
865 | }; | ||
866 | ( await ) => { | ||
867 | $crate::SyntaxKind::AWAIT_KW | ||
868 | }; | ||
869 | ( auto ) => { | ||
870 | $crate::SyntaxKind::AUTO_KW | ||
871 | }; | ||
872 | ( default ) => { | ||
873 | $crate::SyntaxKind::DEFAULT_KW | ||
874 | }; | ||
875 | ( existential ) => { | ||
876 | $crate::SyntaxKind::EXISTENTIAL_KW | ||
877 | }; | ||
878 | ( union ) => { | ||
879 | $crate::SyntaxKind::UNION_KW | ||
880 | }; | ||
881 | } | ||
diff --git a/crates/ra_parser/src/syntax_kind/generated.rs.tera b/crates/ra_parser/src/syntax_kind/generated.rs.tera deleted file mode 100644 index f5abbec4b..000000000 --- a/crates/ra_parser/src/syntax_kind/generated.rs.tera +++ /dev/null | |||
@@ -1,128 +0,0 @@ | |||
1 | {# THIS File is not automatically generated: | ||
2 | the below applies to the result of this template | ||
3 | #}// This file is automatically generated based on the file `./generated.rs.tera` when `cargo gen-syntax` is run | ||
4 | // Do not edit manually | ||
5 | |||
6 | #![allow(bad_style, missing_docs, unreachable_pub)] | ||
7 | #![cfg_attr(rustfmt, rustfmt_skip)] | ||
8 | use super::SyntaxInfo; | ||
9 | |||
10 | /// The kind of syntax node, e.g. `IDENT`, `USE_KW`, or `STRUCT_DEF`. | ||
11 | #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] | ||
12 | #[repr(u16)] | ||
13 | pub enum SyntaxKind { | ||
14 | // Technical SyntaxKinds: they appear temporally during parsing, | ||
15 | // but never end up in the final tree | ||
16 | #[doc(hidden)] | ||
17 | TOMBSTONE, | ||
18 | #[doc(hidden)] | ||
19 | EOF, | ||
20 | |||
21 | {%- for t in concat(a=single_byte_tokens, b=multi_byte_tokens) %} | ||
22 | {{t.1}}, | ||
23 | {%- endfor -%} | ||
24 | {% for kw in concat(a=keywords, b=contextual_keywords) %} | ||
25 | {{kw | upper}}_KW, | ||
26 | {%- endfor -%} | ||
27 | {% for t in concat(a=literals, b=tokens, c=nodes) %} | ||
28 | {{t}}, | ||
29 | {%- endfor %} | ||
30 | // Technical kind so that we can cast from u16 safely | ||
31 | #[doc(hidden)] | ||
32 | __LAST, | ||
33 | } | ||
34 | use self::SyntaxKind::*; | ||
35 | |||
36 | #[macro_export] | ||
37 | macro_rules! T { | ||
38 | {%- for t in concat(a=single_byte_tokens, b=multi_byte_tokens) %} | ||
39 | {%- if t.0 == '{' or t.0 == '}' or t.0 == '[' or t.0 == ']' or t.0 == '(' or t.0 == ')' %} | ||
40 | ('{{t.0}}') => { $crate::SyntaxKind::{{t.1}} }; | ||
41 | {%- else %} | ||
42 | ({{t.0}}) => { $crate::SyntaxKind::{{t.1}} }; | ||
43 | {%- endif %} | ||
44 | {%- endfor -%} | ||
45 | {% for kw in concat(a=keywords, b=contextual_keywords) %} | ||
46 | ({{kw}}) => { $crate::SyntaxKind::{{kw | upper}}_KW }; | ||
47 | {%- endfor %} | ||
48 | } | ||
49 | |||
50 | impl From<u16> for SyntaxKind { | ||
51 | fn from(d: u16) -> SyntaxKind { | ||
52 | assert!(d <= (__LAST as u16)); | ||
53 | unsafe { std::mem::transmute::<u16, SyntaxKind>(d) } | ||
54 | } | ||
55 | } | ||
56 | |||
57 | impl From<SyntaxKind> for u16 { | ||
58 | fn from(k: SyntaxKind) -> u16 { | ||
59 | k as u16 | ||
60 | } | ||
61 | } | ||
62 | |||
63 | impl SyntaxKind { | ||
64 | pub fn is_keyword(self) -> bool { | ||
65 | match self { | ||
66 | {%- for kw in concat(a=keywords, b=contextual_keywords) %} | ||
67 | | {{kw | upper}}_KW | ||
68 | {%- endfor %} | ||
69 | => true, | ||
70 | _ => false | ||
71 | } | ||
72 | } | ||
73 | |||
74 | pub fn is_punct(self) -> bool { | ||
75 | match self { | ||
76 | {%- for t in concat(a=single_byte_tokens, b=multi_byte_tokens) %} | ||
77 | | {{t.1}} | ||
78 | {%- endfor %} | ||
79 | => true, | ||
80 | _ => false | ||
81 | } | ||
82 | } | ||
83 | pub fn is_literal(self) -> bool { | ||
84 | match self { | ||
85 | {%- for t in literals %} | ||
86 | | {{t}} | ||
87 | {%- endfor %} | ||
88 | => true, | ||
89 | _ => false | ||
90 | } | ||
91 | } | ||
92 | |||
93 | pub(crate) fn info(self) -> &'static SyntaxInfo { | ||
94 | match self { | ||
95 | {%- for t in concat(a=single_byte_tokens, b=multi_byte_tokens) %} | ||
96 | {{t.1}} => &SyntaxInfo { name: "{{t.1}}" }, | ||
97 | {%- endfor -%} | ||
98 | {% for kw in concat(a=keywords, b=contextual_keywords) %} | ||
99 | {{kw | upper}}_KW => &SyntaxInfo { name: "{{kw | upper}}_KW" }, | ||
100 | {%- endfor -%} | ||
101 | {% for t in concat(a=literals, b=tokens, c=nodes) %} | ||
102 | {{t}} => &SyntaxInfo { name: "{{t}}" }, | ||
103 | {%- endfor %} | ||
104 | TOMBSTONE => &SyntaxInfo { name: "TOMBSTONE" }, | ||
105 | EOF => &SyntaxInfo { name: "EOF" }, | ||
106 | __LAST => &SyntaxInfo { name: "__LAST" }, | ||
107 | } | ||
108 | } | ||
109 | pub fn from_keyword(ident: &str) -> Option<SyntaxKind> { | ||
110 | let kw = match ident { | ||
111 | {%- for kw in keywords %} | ||
112 | "{{kw}}" => {{kw | upper}}_KW, | ||
113 | {%- endfor %} | ||
114 | _ => return None, | ||
115 | }; | ||
116 | Some(kw) | ||
117 | } | ||
118 | |||
119 | pub fn from_char(c: char) -> Option<SyntaxKind> { | ||
120 | let tok = match c { | ||
121 | {%- for t in single_byte_tokens %} | ||
122 | '{{t.0}}' => {{t.1}}, | ||
123 | {%- endfor %} | ||
124 | _ => return None, | ||
125 | }; | ||
126 | Some(tok) | ||
127 | } | ||
128 | } | ||