rune/ast/
generated.rs

1use crate::alloc::clone;
2use crate::ast;
3use crate::compile;
4use crate::macros;
5use crate::parse;
6use core::fmt;
7
8use crate as rune;
9
10// This file has been generated from `assets/tokens.yaml`
11// DO NOT modify by hand!
12
13/// The `abstract` keyword.
14#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
15#[try_clone(copy)]
16#[non_exhaustive]
17pub struct Abstract {
18    /// Associated span.
19    pub span: ast::Span,
20}
21
22impl ast::Spanned for Abstract {
23    #[inline]
24    fn span(&self) -> ast::Span {
25        self.span
26    }
27}
28
29impl ast::OptionSpanned for Abstract {
30    #[inline]
31    fn option_span(&self) -> Option<ast::Span> {
32        Some(self.span)
33    }
34}
35
36impl ast::ToAst for Abstract {
37    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
38        match kind {
39            ast::Kind::Abstract => Ok(Self { span }),
40            _ => Err(compile::Error::expected(
41                ast::Token { span, kind },
42                ast::Kind::Abstract,
43            )),
44        }
45    }
46
47    fn matches(kind: &ast::Kind) -> bool {
48        match kind {
49            ast::Kind::Abstract => true,
50            _ => false,
51        }
52    }
53
54    #[inline]
55    fn into_expectation() -> parse::Expectation {
56        parse::Expectation::Keyword("abstract")
57    }
58}
59
60impl parse::Parse for Abstract {
61    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
62        let token = p.next()?;
63
64        match token.kind {
65            ast::Kind::Abstract => Ok(Self { span: token.span }),
66            _ => Err(compile::Error::expected(token, ast::Kind::Abstract)),
67        }
68    }
69}
70
71impl parse::Peek for Abstract {
72    #[inline]
73    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
74        matches!(peeker.nth(0), ast::Kind::Abstract)
75    }
76}
77
78impl macros::ToTokens for Abstract {
79    fn to_tokens(
80        &self,
81        _: &mut macros::MacroContext<'_, '_, '_>,
82        stream: &mut macros::TokenStream,
83    ) -> crate::alloc::Result<()> {
84        stream.push(ast::Token {
85            span: self.span,
86            kind: ast::Kind::Abstract,
87        })
88    }
89}
90
91/// The `alignof` keyword.
92#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
93#[try_clone(copy)]
94#[non_exhaustive]
95pub struct AlignOf {
96    /// Associated span.
97    pub span: ast::Span,
98}
99
100impl ast::Spanned for AlignOf {
101    #[inline]
102    fn span(&self) -> ast::Span {
103        self.span
104    }
105}
106
107impl ast::OptionSpanned for AlignOf {
108    #[inline]
109    fn option_span(&self) -> Option<ast::Span> {
110        Some(self.span)
111    }
112}
113
114impl ast::ToAst for AlignOf {
115    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
116        match kind {
117            ast::Kind::AlignOf => Ok(Self { span }),
118            _ => Err(compile::Error::expected(
119                ast::Token { span, kind },
120                ast::Kind::AlignOf,
121            )),
122        }
123    }
124
125    fn matches(kind: &ast::Kind) -> bool {
126        match kind {
127            ast::Kind::AlignOf => true,
128            _ => false,
129        }
130    }
131
132    #[inline]
133    fn into_expectation() -> parse::Expectation {
134        parse::Expectation::Keyword("alignof")
135    }
136}
137
138impl parse::Parse for AlignOf {
139    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
140        let token = p.next()?;
141
142        match token.kind {
143            ast::Kind::AlignOf => Ok(Self { span: token.span }),
144            _ => Err(compile::Error::expected(token, ast::Kind::AlignOf)),
145        }
146    }
147}
148
149impl parse::Peek for AlignOf {
150    #[inline]
151    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
152        matches!(peeker.nth(0), ast::Kind::AlignOf)
153    }
154}
155
156impl macros::ToTokens for AlignOf {
157    fn to_tokens(
158        &self,
159        _: &mut macros::MacroContext<'_, '_, '_>,
160        stream: &mut macros::TokenStream,
161    ) -> crate::alloc::Result<()> {
162        stream.push(ast::Token {
163            span: self.span,
164            kind: ast::Kind::AlignOf,
165        })
166    }
167}
168
169/// `&`.
170#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
171#[try_clone(copy)]
172#[non_exhaustive]
173pub struct Amp {
174    /// Associated span.
175    pub span: ast::Span,
176}
177
178impl ast::Spanned for Amp {
179    #[inline]
180    fn span(&self) -> ast::Span {
181        self.span
182    }
183}
184
185impl ast::OptionSpanned for Amp {
186    #[inline]
187    fn option_span(&self) -> Option<ast::Span> {
188        Some(self.span)
189    }
190}
191
192impl ast::ToAst for Amp {
193    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
194        match kind {
195            ast::Kind::Amp => Ok(Self { span }),
196            _ => Err(compile::Error::expected(
197                ast::Token { span, kind },
198                ast::Kind::Amp,
199            )),
200        }
201    }
202
203    fn matches(kind: &ast::Kind) -> bool {
204        match kind {
205            ast::Kind::Amp => true,
206            _ => false,
207        }
208    }
209
210    #[inline]
211    fn into_expectation() -> parse::Expectation {
212        parse::Expectation::Punctuation("&")
213    }
214}
215
216impl parse::Parse for Amp {
217    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
218        let token = p.next()?;
219
220        match token.kind {
221            ast::Kind::Amp => Ok(Self { span: token.span }),
222            _ => Err(compile::Error::expected(token, ast::Kind::Amp)),
223        }
224    }
225}
226
227impl parse::Peek for Amp {
228    #[inline]
229    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
230        matches!(peeker.nth(0), ast::Kind::Amp)
231    }
232}
233
234impl macros::ToTokens for Amp {
235    fn to_tokens(
236        &self,
237        _: &mut macros::MacroContext<'_, '_, '_>,
238        stream: &mut macros::TokenStream,
239    ) -> crate::alloc::Result<()> {
240        stream.push(ast::Token {
241            span: self.span,
242            kind: ast::Kind::Amp,
243        })
244    }
245}
246
247/// `&&`.
248#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
249#[try_clone(copy)]
250#[non_exhaustive]
251pub struct AmpAmp {
252    /// Associated span.
253    pub span: ast::Span,
254}
255
256impl ast::Spanned for AmpAmp {
257    #[inline]
258    fn span(&self) -> ast::Span {
259        self.span
260    }
261}
262
263impl ast::OptionSpanned for AmpAmp {
264    #[inline]
265    fn option_span(&self) -> Option<ast::Span> {
266        Some(self.span)
267    }
268}
269
270impl ast::ToAst for AmpAmp {
271    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
272        match kind {
273            ast::Kind::AmpAmp => Ok(Self { span }),
274            _ => Err(compile::Error::expected(
275                ast::Token { span, kind },
276                ast::Kind::AmpAmp,
277            )),
278        }
279    }
280
281    fn matches(kind: &ast::Kind) -> bool {
282        match kind {
283            ast::Kind::AmpAmp => true,
284            _ => false,
285        }
286    }
287
288    #[inline]
289    fn into_expectation() -> parse::Expectation {
290        parse::Expectation::Punctuation("&&")
291    }
292}
293
294impl parse::Parse for AmpAmp {
295    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
296        let token = p.next()?;
297
298        match token.kind {
299            ast::Kind::AmpAmp => Ok(Self { span: token.span }),
300            _ => Err(compile::Error::expected(token, ast::Kind::AmpAmp)),
301        }
302    }
303}
304
305impl parse::Peek for AmpAmp {
306    #[inline]
307    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
308        matches!(peeker.nth(0), ast::Kind::AmpAmp)
309    }
310}
311
312impl macros::ToTokens for AmpAmp {
313    fn to_tokens(
314        &self,
315        _: &mut macros::MacroContext<'_, '_, '_>,
316        stream: &mut macros::TokenStream,
317    ) -> crate::alloc::Result<()> {
318        stream.push(ast::Token {
319            span: self.span,
320            kind: ast::Kind::AmpAmp,
321        })
322    }
323}
324
325/// `&=`.
326#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
327#[try_clone(copy)]
328#[non_exhaustive]
329pub struct AmpEq {
330    /// Associated span.
331    pub span: ast::Span,
332}
333
334impl ast::Spanned for AmpEq {
335    #[inline]
336    fn span(&self) -> ast::Span {
337        self.span
338    }
339}
340
341impl ast::OptionSpanned for AmpEq {
342    #[inline]
343    fn option_span(&self) -> Option<ast::Span> {
344        Some(self.span)
345    }
346}
347
348impl ast::ToAst for AmpEq {
349    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
350        match kind {
351            ast::Kind::AmpEq => Ok(Self { span }),
352            _ => Err(compile::Error::expected(
353                ast::Token { span, kind },
354                ast::Kind::AmpEq,
355            )),
356        }
357    }
358
359    fn matches(kind: &ast::Kind) -> bool {
360        match kind {
361            ast::Kind::AmpEq => true,
362            _ => false,
363        }
364    }
365
366    #[inline]
367    fn into_expectation() -> parse::Expectation {
368        parse::Expectation::Punctuation("&=")
369    }
370}
371
372impl parse::Parse for AmpEq {
373    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
374        let token = p.next()?;
375
376        match token.kind {
377            ast::Kind::AmpEq => Ok(Self { span: token.span }),
378            _ => Err(compile::Error::expected(token, ast::Kind::AmpEq)),
379        }
380    }
381}
382
383impl parse::Peek for AmpEq {
384    #[inline]
385    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
386        matches!(peeker.nth(0), ast::Kind::AmpEq)
387    }
388}
389
390impl macros::ToTokens for AmpEq {
391    fn to_tokens(
392        &self,
393        _: &mut macros::MacroContext<'_, '_, '_>,
394        stream: &mut macros::TokenStream,
395    ) -> crate::alloc::Result<()> {
396        stream.push(ast::Token {
397            span: self.span,
398            kind: ast::Kind::AmpEq,
399        })
400    }
401}
402
403/// `->`.
404#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
405#[try_clone(copy)]
406#[non_exhaustive]
407pub struct Arrow {
408    /// Associated span.
409    pub span: ast::Span,
410}
411
412impl ast::Spanned for Arrow {
413    #[inline]
414    fn span(&self) -> ast::Span {
415        self.span
416    }
417}
418
419impl ast::OptionSpanned for Arrow {
420    #[inline]
421    fn option_span(&self) -> Option<ast::Span> {
422        Some(self.span)
423    }
424}
425
426impl ast::ToAst for Arrow {
427    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
428        match kind {
429            ast::Kind::Arrow => Ok(Self { span }),
430            _ => Err(compile::Error::expected(
431                ast::Token { span, kind },
432                ast::Kind::Arrow,
433            )),
434        }
435    }
436
437    fn matches(kind: &ast::Kind) -> bool {
438        match kind {
439            ast::Kind::Arrow => true,
440            _ => false,
441        }
442    }
443
444    #[inline]
445    fn into_expectation() -> parse::Expectation {
446        parse::Expectation::Punctuation("->")
447    }
448}
449
450impl parse::Parse for Arrow {
451    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
452        let token = p.next()?;
453
454        match token.kind {
455            ast::Kind::Arrow => Ok(Self { span: token.span }),
456            _ => Err(compile::Error::expected(token, ast::Kind::Arrow)),
457        }
458    }
459}
460
461impl parse::Peek for Arrow {
462    #[inline]
463    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
464        matches!(peeker.nth(0), ast::Kind::Arrow)
465    }
466}
467
468impl macros::ToTokens for Arrow {
469    fn to_tokens(
470        &self,
471        _: &mut macros::MacroContext<'_, '_, '_>,
472        stream: &mut macros::TokenStream,
473    ) -> crate::alloc::Result<()> {
474        stream.push(ast::Token {
475            span: self.span,
476            kind: ast::Kind::Arrow,
477        })
478    }
479}
480
481/// The `as` keyword.
482#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
483#[try_clone(copy)]
484#[non_exhaustive]
485pub struct As {
486    /// Associated span.
487    pub span: ast::Span,
488}
489
490impl ast::Spanned for As {
491    #[inline]
492    fn span(&self) -> ast::Span {
493        self.span
494    }
495}
496
497impl ast::OptionSpanned for As {
498    #[inline]
499    fn option_span(&self) -> Option<ast::Span> {
500        Some(self.span)
501    }
502}
503
504impl ast::ToAst for As {
505    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
506        match kind {
507            ast::Kind::As => Ok(Self { span }),
508            _ => Err(compile::Error::expected(
509                ast::Token { span, kind },
510                ast::Kind::As,
511            )),
512        }
513    }
514
515    fn matches(kind: &ast::Kind) -> bool {
516        match kind {
517            ast::Kind::As => true,
518            _ => false,
519        }
520    }
521
522    #[inline]
523    fn into_expectation() -> parse::Expectation {
524        parse::Expectation::Keyword("as")
525    }
526}
527
528impl parse::Parse for As {
529    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
530        let token = p.next()?;
531
532        match token.kind {
533            ast::Kind::As => Ok(Self { span: token.span }),
534            _ => Err(compile::Error::expected(token, ast::Kind::As)),
535        }
536    }
537}
538
539impl parse::Peek for As {
540    #[inline]
541    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
542        matches!(peeker.nth(0), ast::Kind::As)
543    }
544}
545
546impl macros::ToTokens for As {
547    fn to_tokens(
548        &self,
549        _: &mut macros::MacroContext<'_, '_, '_>,
550        stream: &mut macros::TokenStream,
551    ) -> crate::alloc::Result<()> {
552        stream.push(ast::Token {
553            span: self.span,
554            kind: ast::Kind::As,
555        })
556    }
557}
558
559/// The `async` keyword.
560#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
561#[try_clone(copy)]
562#[non_exhaustive]
563pub struct Async {
564    /// Associated span.
565    pub span: ast::Span,
566}
567
568impl ast::Spanned for Async {
569    #[inline]
570    fn span(&self) -> ast::Span {
571        self.span
572    }
573}
574
575impl ast::OptionSpanned for Async {
576    #[inline]
577    fn option_span(&self) -> Option<ast::Span> {
578        Some(self.span)
579    }
580}
581
582impl ast::ToAst for Async {
583    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
584        match kind {
585            ast::Kind::Async => Ok(Self { span }),
586            _ => Err(compile::Error::expected(
587                ast::Token { span, kind },
588                ast::Kind::Async,
589            )),
590        }
591    }
592
593    fn matches(kind: &ast::Kind) -> bool {
594        match kind {
595            ast::Kind::Async => true,
596            _ => false,
597        }
598    }
599
600    #[inline]
601    fn into_expectation() -> parse::Expectation {
602        parse::Expectation::Keyword("async")
603    }
604}
605
606impl parse::Parse for Async {
607    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
608        let token = p.next()?;
609
610        match token.kind {
611            ast::Kind::Async => Ok(Self { span: token.span }),
612            _ => Err(compile::Error::expected(token, ast::Kind::Async)),
613        }
614    }
615}
616
617impl parse::Peek for Async {
618    #[inline]
619    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
620        matches!(peeker.nth(0), ast::Kind::Async)
621    }
622}
623
624impl macros::ToTokens for Async {
625    fn to_tokens(
626        &self,
627        _: &mut macros::MacroContext<'_, '_, '_>,
628        stream: &mut macros::TokenStream,
629    ) -> crate::alloc::Result<()> {
630        stream.push(ast::Token {
631            span: self.span,
632            kind: ast::Kind::Async,
633        })
634    }
635}
636
637/// `@`.
638#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
639#[try_clone(copy)]
640#[non_exhaustive]
641pub struct At {
642    /// Associated span.
643    pub span: ast::Span,
644}
645
646impl ast::Spanned for At {
647    #[inline]
648    fn span(&self) -> ast::Span {
649        self.span
650    }
651}
652
653impl ast::OptionSpanned for At {
654    #[inline]
655    fn option_span(&self) -> Option<ast::Span> {
656        Some(self.span)
657    }
658}
659
660impl ast::ToAst for At {
661    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
662        match kind {
663            ast::Kind::At => Ok(Self { span }),
664            _ => Err(compile::Error::expected(
665                ast::Token { span, kind },
666                ast::Kind::At,
667            )),
668        }
669    }
670
671    fn matches(kind: &ast::Kind) -> bool {
672        match kind {
673            ast::Kind::At => true,
674            _ => false,
675        }
676    }
677
678    #[inline]
679    fn into_expectation() -> parse::Expectation {
680        parse::Expectation::Punctuation("@")
681    }
682}
683
684impl parse::Parse for At {
685    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
686        let token = p.next()?;
687
688        match token.kind {
689            ast::Kind::At => Ok(Self { span: token.span }),
690            _ => Err(compile::Error::expected(token, ast::Kind::At)),
691        }
692    }
693}
694
695impl parse::Peek for At {
696    #[inline]
697    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
698        matches!(peeker.nth(0), ast::Kind::At)
699    }
700}
701
702impl macros::ToTokens for At {
703    fn to_tokens(
704        &self,
705        _: &mut macros::MacroContext<'_, '_, '_>,
706        stream: &mut macros::TokenStream,
707    ) -> crate::alloc::Result<()> {
708        stream.push(ast::Token {
709            span: self.span,
710            kind: ast::Kind::At,
711        })
712    }
713}
714
715/// The `await` keyword.
716#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
717#[try_clone(copy)]
718#[non_exhaustive]
719pub struct Await {
720    /// Associated span.
721    pub span: ast::Span,
722}
723
724impl ast::Spanned for Await {
725    #[inline]
726    fn span(&self) -> ast::Span {
727        self.span
728    }
729}
730
731impl ast::OptionSpanned for Await {
732    #[inline]
733    fn option_span(&self) -> Option<ast::Span> {
734        Some(self.span)
735    }
736}
737
738impl ast::ToAst for Await {
739    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
740        match kind {
741            ast::Kind::Await => Ok(Self { span }),
742            _ => Err(compile::Error::expected(
743                ast::Token { span, kind },
744                ast::Kind::Await,
745            )),
746        }
747    }
748
749    fn matches(kind: &ast::Kind) -> bool {
750        match kind {
751            ast::Kind::Await => true,
752            _ => false,
753        }
754    }
755
756    #[inline]
757    fn into_expectation() -> parse::Expectation {
758        parse::Expectation::Keyword("await")
759    }
760}
761
762impl parse::Parse for Await {
763    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
764        let token = p.next()?;
765
766        match token.kind {
767            ast::Kind::Await => Ok(Self { span: token.span }),
768            _ => Err(compile::Error::expected(token, ast::Kind::Await)),
769        }
770    }
771}
772
773impl parse::Peek for Await {
774    #[inline]
775    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
776        matches!(peeker.nth(0), ast::Kind::Await)
777    }
778}
779
780impl macros::ToTokens for Await {
781    fn to_tokens(
782        &self,
783        _: &mut macros::MacroContext<'_, '_, '_>,
784        stream: &mut macros::TokenStream,
785    ) -> crate::alloc::Result<()> {
786        stream.push(ast::Token {
787            span: self.span,
788            kind: ast::Kind::Await,
789        })
790    }
791}
792
793/// `!`.
794#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
795#[try_clone(copy)]
796#[non_exhaustive]
797pub struct Bang {
798    /// Associated span.
799    pub span: ast::Span,
800}
801
802impl ast::Spanned for Bang {
803    #[inline]
804    fn span(&self) -> ast::Span {
805        self.span
806    }
807}
808
809impl ast::OptionSpanned for Bang {
810    #[inline]
811    fn option_span(&self) -> Option<ast::Span> {
812        Some(self.span)
813    }
814}
815
816impl ast::ToAst for Bang {
817    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
818        match kind {
819            ast::Kind::Bang => Ok(Self { span }),
820            _ => Err(compile::Error::expected(
821                ast::Token { span, kind },
822                ast::Kind::Bang,
823            )),
824        }
825    }
826
827    fn matches(kind: &ast::Kind) -> bool {
828        match kind {
829            ast::Kind::Bang => true,
830            _ => false,
831        }
832    }
833
834    #[inline]
835    fn into_expectation() -> parse::Expectation {
836        parse::Expectation::Punctuation("!")
837    }
838}
839
840impl parse::Parse for Bang {
841    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
842        let token = p.next()?;
843
844        match token.kind {
845            ast::Kind::Bang => Ok(Self { span: token.span }),
846            _ => Err(compile::Error::expected(token, ast::Kind::Bang)),
847        }
848    }
849}
850
851impl parse::Peek for Bang {
852    #[inline]
853    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
854        matches!(peeker.nth(0), ast::Kind::Bang)
855    }
856}
857
858impl macros::ToTokens for Bang {
859    fn to_tokens(
860        &self,
861        _: &mut macros::MacroContext<'_, '_, '_>,
862        stream: &mut macros::TokenStream,
863    ) -> crate::alloc::Result<()> {
864        stream.push(ast::Token {
865            span: self.span,
866            kind: ast::Kind::Bang,
867        })
868    }
869}
870
871/// `!=`.
872#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
873#[try_clone(copy)]
874#[non_exhaustive]
875pub struct BangEq {
876    /// Associated span.
877    pub span: ast::Span,
878}
879
880impl ast::Spanned for BangEq {
881    #[inline]
882    fn span(&self) -> ast::Span {
883        self.span
884    }
885}
886
887impl ast::OptionSpanned for BangEq {
888    #[inline]
889    fn option_span(&self) -> Option<ast::Span> {
890        Some(self.span)
891    }
892}
893
894impl ast::ToAst for BangEq {
895    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
896        match kind {
897            ast::Kind::BangEq => Ok(Self { span }),
898            _ => Err(compile::Error::expected(
899                ast::Token { span, kind },
900                ast::Kind::BangEq,
901            )),
902        }
903    }
904
905    fn matches(kind: &ast::Kind) -> bool {
906        match kind {
907            ast::Kind::BangEq => true,
908            _ => false,
909        }
910    }
911
912    #[inline]
913    fn into_expectation() -> parse::Expectation {
914        parse::Expectation::Punctuation("!=")
915    }
916}
917
918impl parse::Parse for BangEq {
919    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
920        let token = p.next()?;
921
922        match token.kind {
923            ast::Kind::BangEq => Ok(Self { span: token.span }),
924            _ => Err(compile::Error::expected(token, ast::Kind::BangEq)),
925        }
926    }
927}
928
929impl parse::Peek for BangEq {
930    #[inline]
931    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
932        matches!(peeker.nth(0), ast::Kind::BangEq)
933    }
934}
935
936impl macros::ToTokens for BangEq {
937    fn to_tokens(
938        &self,
939        _: &mut macros::MacroContext<'_, '_, '_>,
940        stream: &mut macros::TokenStream,
941    ) -> crate::alloc::Result<()> {
942        stream.push(ast::Token {
943            span: self.span,
944            kind: ast::Kind::BangEq,
945        })
946    }
947}
948
949/// The `become` keyword.
950#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
951#[try_clone(copy)]
952#[non_exhaustive]
953pub struct Become {
954    /// Associated span.
955    pub span: ast::Span,
956}
957
958impl ast::Spanned for Become {
959    #[inline]
960    fn span(&self) -> ast::Span {
961        self.span
962    }
963}
964
965impl ast::OptionSpanned for Become {
966    #[inline]
967    fn option_span(&self) -> Option<ast::Span> {
968        Some(self.span)
969    }
970}
971
972impl ast::ToAst for Become {
973    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
974        match kind {
975            ast::Kind::Become => Ok(Self { span }),
976            _ => Err(compile::Error::expected(
977                ast::Token { span, kind },
978                ast::Kind::Become,
979            )),
980        }
981    }
982
983    fn matches(kind: &ast::Kind) -> bool {
984        match kind {
985            ast::Kind::Become => true,
986            _ => false,
987        }
988    }
989
990    #[inline]
991    fn into_expectation() -> parse::Expectation {
992        parse::Expectation::Keyword("become")
993    }
994}
995
996impl parse::Parse for Become {
997    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
998        let token = p.next()?;
999
1000        match token.kind {
1001            ast::Kind::Become => Ok(Self { span: token.span }),
1002            _ => Err(compile::Error::expected(token, ast::Kind::Become)),
1003        }
1004    }
1005}
1006
1007impl parse::Peek for Become {
1008    #[inline]
1009    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
1010        matches!(peeker.nth(0), ast::Kind::Become)
1011    }
1012}
1013
1014impl macros::ToTokens for Become {
1015    fn to_tokens(
1016        &self,
1017        _: &mut macros::MacroContext<'_, '_, '_>,
1018        stream: &mut macros::TokenStream,
1019    ) -> crate::alloc::Result<()> {
1020        stream.push(ast::Token {
1021            span: self.span,
1022            kind: ast::Kind::Become,
1023        })
1024    }
1025}
1026
1027/// The `break` keyword.
1028#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
1029#[try_clone(copy)]
1030#[non_exhaustive]
1031pub struct Break {
1032    /// Associated span.
1033    pub span: ast::Span,
1034}
1035
1036impl ast::Spanned for Break {
1037    #[inline]
1038    fn span(&self) -> ast::Span {
1039        self.span
1040    }
1041}
1042
1043impl ast::OptionSpanned for Break {
1044    #[inline]
1045    fn option_span(&self) -> Option<ast::Span> {
1046        Some(self.span)
1047    }
1048}
1049
1050impl ast::ToAst for Break {
1051    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
1052        match kind {
1053            ast::Kind::Break => Ok(Self { span }),
1054            _ => Err(compile::Error::expected(
1055                ast::Token { span, kind },
1056                ast::Kind::Break,
1057            )),
1058        }
1059    }
1060
1061    fn matches(kind: &ast::Kind) -> bool {
1062        match kind {
1063            ast::Kind::Break => true,
1064            _ => false,
1065        }
1066    }
1067
1068    #[inline]
1069    fn into_expectation() -> parse::Expectation {
1070        parse::Expectation::Keyword("break")
1071    }
1072}
1073
1074impl parse::Parse for Break {
1075    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
1076        let token = p.next()?;
1077
1078        match token.kind {
1079            ast::Kind::Break => Ok(Self { span: token.span }),
1080            _ => Err(compile::Error::expected(token, ast::Kind::Break)),
1081        }
1082    }
1083}
1084
1085impl parse::Peek for Break {
1086    #[inline]
1087    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
1088        matches!(peeker.nth(0), ast::Kind::Break)
1089    }
1090}
1091
1092impl macros::ToTokens for Break {
1093    fn to_tokens(
1094        &self,
1095        _: &mut macros::MacroContext<'_, '_, '_>,
1096        stream: &mut macros::TokenStream,
1097    ) -> crate::alloc::Result<()> {
1098        stream.push(ast::Token {
1099            span: self.span,
1100            kind: ast::Kind::Break,
1101        })
1102    }
1103}
1104
1105/// `^`.
1106#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
1107#[try_clone(copy)]
1108#[non_exhaustive]
1109pub struct Caret {
1110    /// Associated span.
1111    pub span: ast::Span,
1112}
1113
1114impl ast::Spanned for Caret {
1115    #[inline]
1116    fn span(&self) -> ast::Span {
1117        self.span
1118    }
1119}
1120
1121impl ast::OptionSpanned for Caret {
1122    #[inline]
1123    fn option_span(&self) -> Option<ast::Span> {
1124        Some(self.span)
1125    }
1126}
1127
1128impl ast::ToAst for Caret {
1129    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
1130        match kind {
1131            ast::Kind::Caret => Ok(Self { span }),
1132            _ => Err(compile::Error::expected(
1133                ast::Token { span, kind },
1134                ast::Kind::Caret,
1135            )),
1136        }
1137    }
1138
1139    fn matches(kind: &ast::Kind) -> bool {
1140        match kind {
1141            ast::Kind::Caret => true,
1142            _ => false,
1143        }
1144    }
1145
1146    #[inline]
1147    fn into_expectation() -> parse::Expectation {
1148        parse::Expectation::Punctuation("^")
1149    }
1150}
1151
1152impl parse::Parse for Caret {
1153    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
1154        let token = p.next()?;
1155
1156        match token.kind {
1157            ast::Kind::Caret => Ok(Self { span: token.span }),
1158            _ => Err(compile::Error::expected(token, ast::Kind::Caret)),
1159        }
1160    }
1161}
1162
1163impl parse::Peek for Caret {
1164    #[inline]
1165    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
1166        matches!(peeker.nth(0), ast::Kind::Caret)
1167    }
1168}
1169
1170impl macros::ToTokens for Caret {
1171    fn to_tokens(
1172        &self,
1173        _: &mut macros::MacroContext<'_, '_, '_>,
1174        stream: &mut macros::TokenStream,
1175    ) -> crate::alloc::Result<()> {
1176        stream.push(ast::Token {
1177            span: self.span,
1178            kind: ast::Kind::Caret,
1179        })
1180    }
1181}
1182
1183/// `^=`.
1184#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
1185#[try_clone(copy)]
1186#[non_exhaustive]
1187pub struct CaretEq {
1188    /// Associated span.
1189    pub span: ast::Span,
1190}
1191
1192impl ast::Spanned for CaretEq {
1193    #[inline]
1194    fn span(&self) -> ast::Span {
1195        self.span
1196    }
1197}
1198
1199impl ast::OptionSpanned for CaretEq {
1200    #[inline]
1201    fn option_span(&self) -> Option<ast::Span> {
1202        Some(self.span)
1203    }
1204}
1205
1206impl ast::ToAst for CaretEq {
1207    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
1208        match kind {
1209            ast::Kind::CaretEq => Ok(Self { span }),
1210            _ => Err(compile::Error::expected(
1211                ast::Token { span, kind },
1212                ast::Kind::CaretEq,
1213            )),
1214        }
1215    }
1216
1217    fn matches(kind: &ast::Kind) -> bool {
1218        match kind {
1219            ast::Kind::CaretEq => true,
1220            _ => false,
1221        }
1222    }
1223
1224    #[inline]
1225    fn into_expectation() -> parse::Expectation {
1226        parse::Expectation::Punctuation("^=")
1227    }
1228}
1229
1230impl parse::Parse for CaretEq {
1231    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
1232        let token = p.next()?;
1233
1234        match token.kind {
1235            ast::Kind::CaretEq => Ok(Self { span: token.span }),
1236            _ => Err(compile::Error::expected(token, ast::Kind::CaretEq)),
1237        }
1238    }
1239}
1240
1241impl parse::Peek for CaretEq {
1242    #[inline]
1243    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
1244        matches!(peeker.nth(0), ast::Kind::CaretEq)
1245    }
1246}
1247
1248impl macros::ToTokens for CaretEq {
1249    fn to_tokens(
1250        &self,
1251        _: &mut macros::MacroContext<'_, '_, '_>,
1252        stream: &mut macros::TokenStream,
1253    ) -> crate::alloc::Result<()> {
1254        stream.push(ast::Token {
1255            span: self.span,
1256            kind: ast::Kind::CaretEq,
1257        })
1258    }
1259}
1260
1261/// `:`.
1262#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
1263#[try_clone(copy)]
1264#[non_exhaustive]
1265pub struct Colon {
1266    /// Associated span.
1267    pub span: ast::Span,
1268}
1269
1270impl ast::Spanned for Colon {
1271    #[inline]
1272    fn span(&self) -> ast::Span {
1273        self.span
1274    }
1275}
1276
1277impl ast::OptionSpanned for Colon {
1278    #[inline]
1279    fn option_span(&self) -> Option<ast::Span> {
1280        Some(self.span)
1281    }
1282}
1283
1284impl ast::ToAst for Colon {
1285    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
1286        match kind {
1287            ast::Kind::Colon => Ok(Self { span }),
1288            _ => Err(compile::Error::expected(
1289                ast::Token { span, kind },
1290                ast::Kind::Colon,
1291            )),
1292        }
1293    }
1294
1295    fn matches(kind: &ast::Kind) -> bool {
1296        match kind {
1297            ast::Kind::Colon => true,
1298            _ => false,
1299        }
1300    }
1301
1302    #[inline]
1303    fn into_expectation() -> parse::Expectation {
1304        parse::Expectation::Punctuation(":")
1305    }
1306}
1307
1308impl parse::Parse for Colon {
1309    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
1310        let token = p.next()?;
1311
1312        match token.kind {
1313            ast::Kind::Colon => Ok(Self { span: token.span }),
1314            _ => Err(compile::Error::expected(token, ast::Kind::Colon)),
1315        }
1316    }
1317}
1318
1319impl parse::Peek for Colon {
1320    #[inline]
1321    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
1322        matches!(peeker.nth(0), ast::Kind::Colon)
1323    }
1324}
1325
1326impl macros::ToTokens for Colon {
1327    fn to_tokens(
1328        &self,
1329        _: &mut macros::MacroContext<'_, '_, '_>,
1330        stream: &mut macros::TokenStream,
1331    ) -> crate::alloc::Result<()> {
1332        stream.push(ast::Token {
1333            span: self.span,
1334            kind: ast::Kind::Colon,
1335        })
1336    }
1337}
1338
1339/// `::`.
1340#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
1341#[try_clone(copy)]
1342#[non_exhaustive]
1343pub struct ColonColon {
1344    /// Associated span.
1345    pub span: ast::Span,
1346}
1347
1348impl ast::Spanned for ColonColon {
1349    #[inline]
1350    fn span(&self) -> ast::Span {
1351        self.span
1352    }
1353}
1354
1355impl ast::OptionSpanned for ColonColon {
1356    #[inline]
1357    fn option_span(&self) -> Option<ast::Span> {
1358        Some(self.span)
1359    }
1360}
1361
1362impl ast::ToAst for ColonColon {
1363    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
1364        match kind {
1365            ast::Kind::ColonColon => Ok(Self { span }),
1366            _ => Err(compile::Error::expected(
1367                ast::Token { span, kind },
1368                ast::Kind::ColonColon,
1369            )),
1370        }
1371    }
1372
1373    fn matches(kind: &ast::Kind) -> bool {
1374        match kind {
1375            ast::Kind::ColonColon => true,
1376            _ => false,
1377        }
1378    }
1379
1380    #[inline]
1381    fn into_expectation() -> parse::Expectation {
1382        parse::Expectation::Punctuation("::")
1383    }
1384}
1385
1386impl parse::Parse for ColonColon {
1387    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
1388        let token = p.next()?;
1389
1390        match token.kind {
1391            ast::Kind::ColonColon => Ok(Self { span: token.span }),
1392            _ => Err(compile::Error::expected(token, ast::Kind::ColonColon)),
1393        }
1394    }
1395}
1396
1397impl parse::Peek for ColonColon {
1398    #[inline]
1399    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
1400        matches!(peeker.nth(0), ast::Kind::ColonColon)
1401    }
1402}
1403
1404impl macros::ToTokens for ColonColon {
1405    fn to_tokens(
1406        &self,
1407        _: &mut macros::MacroContext<'_, '_, '_>,
1408        stream: &mut macros::TokenStream,
1409    ) -> crate::alloc::Result<()> {
1410        stream.push(ast::Token {
1411            span: self.span,
1412            kind: ast::Kind::ColonColon,
1413        })
1414    }
1415}
1416
1417/// `,`.
1418#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
1419#[try_clone(copy)]
1420#[non_exhaustive]
1421pub struct Comma {
1422    /// Associated span.
1423    pub span: ast::Span,
1424}
1425
1426impl ast::Spanned for Comma {
1427    #[inline]
1428    fn span(&self) -> ast::Span {
1429        self.span
1430    }
1431}
1432
1433impl ast::OptionSpanned for Comma {
1434    #[inline]
1435    fn option_span(&self) -> Option<ast::Span> {
1436        Some(self.span)
1437    }
1438}
1439
1440impl ast::ToAst for Comma {
1441    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
1442        match kind {
1443            ast::Kind::Comma => Ok(Self { span }),
1444            _ => Err(compile::Error::expected(
1445                ast::Token { span, kind },
1446                ast::Kind::Comma,
1447            )),
1448        }
1449    }
1450
1451    fn matches(kind: &ast::Kind) -> bool {
1452        match kind {
1453            ast::Kind::Comma => true,
1454            _ => false,
1455        }
1456    }
1457
1458    #[inline]
1459    fn into_expectation() -> parse::Expectation {
1460        parse::Expectation::Punctuation(",")
1461    }
1462}
1463
1464impl parse::Parse for Comma {
1465    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
1466        let token = p.next()?;
1467
1468        match token.kind {
1469            ast::Kind::Comma => Ok(Self { span: token.span }),
1470            _ => Err(compile::Error::expected(token, ast::Kind::Comma)),
1471        }
1472    }
1473}
1474
1475impl parse::Peek for Comma {
1476    #[inline]
1477    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
1478        matches!(peeker.nth(0), ast::Kind::Comma)
1479    }
1480}
1481
1482impl macros::ToTokens for Comma {
1483    fn to_tokens(
1484        &self,
1485        _: &mut macros::MacroContext<'_, '_, '_>,
1486        stream: &mut macros::TokenStream,
1487    ) -> crate::alloc::Result<()> {
1488        stream.push(ast::Token {
1489            span: self.span,
1490            kind: ast::Kind::Comma,
1491        })
1492    }
1493}
1494
1495/// The `const` keyword.
1496#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
1497#[try_clone(copy)]
1498#[non_exhaustive]
1499pub struct Const {
1500    /// Associated span.
1501    pub span: ast::Span,
1502}
1503
1504impl ast::Spanned for Const {
1505    #[inline]
1506    fn span(&self) -> ast::Span {
1507        self.span
1508    }
1509}
1510
1511impl ast::OptionSpanned for Const {
1512    #[inline]
1513    fn option_span(&self) -> Option<ast::Span> {
1514        Some(self.span)
1515    }
1516}
1517
1518impl ast::ToAst for Const {
1519    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
1520        match kind {
1521            ast::Kind::Const => Ok(Self { span }),
1522            _ => Err(compile::Error::expected(
1523                ast::Token { span, kind },
1524                ast::Kind::Const,
1525            )),
1526        }
1527    }
1528
1529    fn matches(kind: &ast::Kind) -> bool {
1530        match kind {
1531            ast::Kind::Const => true,
1532            _ => false,
1533        }
1534    }
1535
1536    #[inline]
1537    fn into_expectation() -> parse::Expectation {
1538        parse::Expectation::Keyword("const")
1539    }
1540}
1541
1542impl parse::Parse for Const {
1543    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
1544        let token = p.next()?;
1545
1546        match token.kind {
1547            ast::Kind::Const => Ok(Self { span: token.span }),
1548            _ => Err(compile::Error::expected(token, ast::Kind::Const)),
1549        }
1550    }
1551}
1552
1553impl parse::Peek for Const {
1554    #[inline]
1555    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
1556        matches!(peeker.nth(0), ast::Kind::Const)
1557    }
1558}
1559
1560impl macros::ToTokens for Const {
1561    fn to_tokens(
1562        &self,
1563        _: &mut macros::MacroContext<'_, '_, '_>,
1564        stream: &mut macros::TokenStream,
1565    ) -> crate::alloc::Result<()> {
1566        stream.push(ast::Token {
1567            span: self.span,
1568            kind: ast::Kind::Const,
1569        })
1570    }
1571}
1572
1573/// The `continue` keyword.
1574#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
1575#[try_clone(copy)]
1576#[non_exhaustive]
1577pub struct Continue {
1578    /// Associated span.
1579    pub span: ast::Span,
1580}
1581
1582impl ast::Spanned for Continue {
1583    #[inline]
1584    fn span(&self) -> ast::Span {
1585        self.span
1586    }
1587}
1588
1589impl ast::OptionSpanned for Continue {
1590    #[inline]
1591    fn option_span(&self) -> Option<ast::Span> {
1592        Some(self.span)
1593    }
1594}
1595
1596impl ast::ToAst for Continue {
1597    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
1598        match kind {
1599            ast::Kind::Continue => Ok(Self { span }),
1600            _ => Err(compile::Error::expected(
1601                ast::Token { span, kind },
1602                ast::Kind::Continue,
1603            )),
1604        }
1605    }
1606
1607    fn matches(kind: &ast::Kind) -> bool {
1608        match kind {
1609            ast::Kind::Continue => true,
1610            _ => false,
1611        }
1612    }
1613
1614    #[inline]
1615    fn into_expectation() -> parse::Expectation {
1616        parse::Expectation::Keyword("continue")
1617    }
1618}
1619
1620impl parse::Parse for Continue {
1621    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
1622        let token = p.next()?;
1623
1624        match token.kind {
1625            ast::Kind::Continue => Ok(Self { span: token.span }),
1626            _ => Err(compile::Error::expected(token, ast::Kind::Continue)),
1627        }
1628    }
1629}
1630
1631impl parse::Peek for Continue {
1632    #[inline]
1633    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
1634        matches!(peeker.nth(0), ast::Kind::Continue)
1635    }
1636}
1637
1638impl macros::ToTokens for Continue {
1639    fn to_tokens(
1640        &self,
1641        _: &mut macros::MacroContext<'_, '_, '_>,
1642        stream: &mut macros::TokenStream,
1643    ) -> crate::alloc::Result<()> {
1644        stream.push(ast::Token {
1645            span: self.span,
1646            kind: ast::Kind::Continue,
1647        })
1648    }
1649}
1650
1651/// The `crate` keyword.
1652#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
1653#[try_clone(copy)]
1654#[non_exhaustive]
1655pub struct Crate {
1656    /// Associated span.
1657    pub span: ast::Span,
1658}
1659
1660impl ast::Spanned for Crate {
1661    #[inline]
1662    fn span(&self) -> ast::Span {
1663        self.span
1664    }
1665}
1666
1667impl ast::OptionSpanned for Crate {
1668    #[inline]
1669    fn option_span(&self) -> Option<ast::Span> {
1670        Some(self.span)
1671    }
1672}
1673
1674impl ast::ToAst for Crate {
1675    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
1676        match kind {
1677            ast::Kind::Crate => Ok(Self { span }),
1678            _ => Err(compile::Error::expected(
1679                ast::Token { span, kind },
1680                ast::Kind::Crate,
1681            )),
1682        }
1683    }
1684
1685    fn matches(kind: &ast::Kind) -> bool {
1686        match kind {
1687            ast::Kind::Crate => true,
1688            _ => false,
1689        }
1690    }
1691
1692    #[inline]
1693    fn into_expectation() -> parse::Expectation {
1694        parse::Expectation::Keyword("crate")
1695    }
1696}
1697
1698impl parse::Parse for Crate {
1699    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
1700        let token = p.next()?;
1701
1702        match token.kind {
1703            ast::Kind::Crate => Ok(Self { span: token.span }),
1704            _ => Err(compile::Error::expected(token, ast::Kind::Crate)),
1705        }
1706    }
1707}
1708
1709impl parse::Peek for Crate {
1710    #[inline]
1711    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
1712        matches!(peeker.nth(0), ast::Kind::Crate)
1713    }
1714}
1715
1716impl macros::ToTokens for Crate {
1717    fn to_tokens(
1718        &self,
1719        _: &mut macros::MacroContext<'_, '_, '_>,
1720        stream: &mut macros::TokenStream,
1721    ) -> crate::alloc::Result<()> {
1722        stream.push(ast::Token {
1723            span: self.span,
1724            kind: ast::Kind::Crate,
1725        })
1726    }
1727}
1728
1729/// `-`.
1730#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
1731#[try_clone(copy)]
1732#[non_exhaustive]
1733pub struct Dash {
1734    /// Associated span.
1735    pub span: ast::Span,
1736}
1737
1738impl ast::Spanned for Dash {
1739    #[inline]
1740    fn span(&self) -> ast::Span {
1741        self.span
1742    }
1743}
1744
1745impl ast::OptionSpanned for Dash {
1746    #[inline]
1747    fn option_span(&self) -> Option<ast::Span> {
1748        Some(self.span)
1749    }
1750}
1751
1752impl ast::ToAst for Dash {
1753    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
1754        match kind {
1755            ast::Kind::Dash => Ok(Self { span }),
1756            _ => Err(compile::Error::expected(
1757                ast::Token { span, kind },
1758                ast::Kind::Dash,
1759            )),
1760        }
1761    }
1762
1763    fn matches(kind: &ast::Kind) -> bool {
1764        match kind {
1765            ast::Kind::Dash => true,
1766            _ => false,
1767        }
1768    }
1769
1770    #[inline]
1771    fn into_expectation() -> parse::Expectation {
1772        parse::Expectation::Punctuation("-")
1773    }
1774}
1775
1776impl parse::Parse for Dash {
1777    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
1778        let token = p.next()?;
1779
1780        match token.kind {
1781            ast::Kind::Dash => Ok(Self { span: token.span }),
1782            _ => Err(compile::Error::expected(token, ast::Kind::Dash)),
1783        }
1784    }
1785}
1786
1787impl parse::Peek for Dash {
1788    #[inline]
1789    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
1790        matches!(peeker.nth(0), ast::Kind::Dash)
1791    }
1792}
1793
1794impl macros::ToTokens for Dash {
1795    fn to_tokens(
1796        &self,
1797        _: &mut macros::MacroContext<'_, '_, '_>,
1798        stream: &mut macros::TokenStream,
1799    ) -> crate::alloc::Result<()> {
1800        stream.push(ast::Token {
1801            span: self.span,
1802            kind: ast::Kind::Dash,
1803        })
1804    }
1805}
1806
1807/// `-=`.
1808#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
1809#[try_clone(copy)]
1810#[non_exhaustive]
1811pub struct DashEq {
1812    /// Associated span.
1813    pub span: ast::Span,
1814}
1815
1816impl ast::Spanned for DashEq {
1817    #[inline]
1818    fn span(&self) -> ast::Span {
1819        self.span
1820    }
1821}
1822
1823impl ast::OptionSpanned for DashEq {
1824    #[inline]
1825    fn option_span(&self) -> Option<ast::Span> {
1826        Some(self.span)
1827    }
1828}
1829
1830impl ast::ToAst for DashEq {
1831    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
1832        match kind {
1833            ast::Kind::DashEq => Ok(Self { span }),
1834            _ => Err(compile::Error::expected(
1835                ast::Token { span, kind },
1836                ast::Kind::DashEq,
1837            )),
1838        }
1839    }
1840
1841    fn matches(kind: &ast::Kind) -> bool {
1842        match kind {
1843            ast::Kind::DashEq => true,
1844            _ => false,
1845        }
1846    }
1847
1848    #[inline]
1849    fn into_expectation() -> parse::Expectation {
1850        parse::Expectation::Punctuation("-=")
1851    }
1852}
1853
1854impl parse::Parse for DashEq {
1855    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
1856        let token = p.next()?;
1857
1858        match token.kind {
1859            ast::Kind::DashEq => Ok(Self { span: token.span }),
1860            _ => Err(compile::Error::expected(token, ast::Kind::DashEq)),
1861        }
1862    }
1863}
1864
1865impl parse::Peek for DashEq {
1866    #[inline]
1867    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
1868        matches!(peeker.nth(0), ast::Kind::DashEq)
1869    }
1870}
1871
1872impl macros::ToTokens for DashEq {
1873    fn to_tokens(
1874        &self,
1875        _: &mut macros::MacroContext<'_, '_, '_>,
1876        stream: &mut macros::TokenStream,
1877    ) -> crate::alloc::Result<()> {
1878        stream.push(ast::Token {
1879            span: self.span,
1880            kind: ast::Kind::DashEq,
1881        })
1882    }
1883}
1884
1885/// The `default` keyword.
1886#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
1887#[try_clone(copy)]
1888#[non_exhaustive]
1889pub struct Default {
1890    /// Associated span.
1891    pub span: ast::Span,
1892}
1893
1894impl ast::Spanned for Default {
1895    #[inline]
1896    fn span(&self) -> ast::Span {
1897        self.span
1898    }
1899}
1900
1901impl ast::OptionSpanned for Default {
1902    #[inline]
1903    fn option_span(&self) -> Option<ast::Span> {
1904        Some(self.span)
1905    }
1906}
1907
1908impl ast::ToAst for Default {
1909    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
1910        match kind {
1911            ast::Kind::Default => Ok(Self { span }),
1912            _ => Err(compile::Error::expected(
1913                ast::Token { span, kind },
1914                ast::Kind::Default,
1915            )),
1916        }
1917    }
1918
1919    fn matches(kind: &ast::Kind) -> bool {
1920        match kind {
1921            ast::Kind::Default => true,
1922            _ => false,
1923        }
1924    }
1925
1926    #[inline]
1927    fn into_expectation() -> parse::Expectation {
1928        parse::Expectation::Keyword("default")
1929    }
1930}
1931
1932impl parse::Parse for Default {
1933    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
1934        let token = p.next()?;
1935
1936        match token.kind {
1937            ast::Kind::Default => Ok(Self { span: token.span }),
1938            _ => Err(compile::Error::expected(token, ast::Kind::Default)),
1939        }
1940    }
1941}
1942
1943impl parse::Peek for Default {
1944    #[inline]
1945    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
1946        matches!(peeker.nth(0), ast::Kind::Default)
1947    }
1948}
1949
1950impl macros::ToTokens for Default {
1951    fn to_tokens(
1952        &self,
1953        _: &mut macros::MacroContext<'_, '_, '_>,
1954        stream: &mut macros::TokenStream,
1955    ) -> crate::alloc::Result<()> {
1956        stream.push(ast::Token {
1957            span: self.span,
1958            kind: ast::Kind::Default,
1959        })
1960    }
1961}
1962
1963/// `/`.
1964#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
1965#[try_clone(copy)]
1966#[non_exhaustive]
1967pub struct Div {
1968    /// Associated span.
1969    pub span: ast::Span,
1970}
1971
1972impl ast::Spanned for Div {
1973    #[inline]
1974    fn span(&self) -> ast::Span {
1975        self.span
1976    }
1977}
1978
1979impl ast::OptionSpanned for Div {
1980    #[inline]
1981    fn option_span(&self) -> Option<ast::Span> {
1982        Some(self.span)
1983    }
1984}
1985
1986impl ast::ToAst for Div {
1987    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
1988        match kind {
1989            ast::Kind::Div => Ok(Self { span }),
1990            _ => Err(compile::Error::expected(
1991                ast::Token { span, kind },
1992                ast::Kind::Div,
1993            )),
1994        }
1995    }
1996
1997    fn matches(kind: &ast::Kind) -> bool {
1998        match kind {
1999            ast::Kind::Div => true,
2000            _ => false,
2001        }
2002    }
2003
2004    #[inline]
2005    fn into_expectation() -> parse::Expectation {
2006        parse::Expectation::Punctuation("/")
2007    }
2008}
2009
2010impl parse::Parse for Div {
2011    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
2012        let token = p.next()?;
2013
2014        match token.kind {
2015            ast::Kind::Div => Ok(Self { span: token.span }),
2016            _ => Err(compile::Error::expected(token, ast::Kind::Div)),
2017        }
2018    }
2019}
2020
2021impl parse::Peek for Div {
2022    #[inline]
2023    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
2024        matches!(peeker.nth(0), ast::Kind::Div)
2025    }
2026}
2027
2028impl macros::ToTokens for Div {
2029    fn to_tokens(
2030        &self,
2031        _: &mut macros::MacroContext<'_, '_, '_>,
2032        stream: &mut macros::TokenStream,
2033    ) -> crate::alloc::Result<()> {
2034        stream.push(ast::Token {
2035            span: self.span,
2036            kind: ast::Kind::Div,
2037        })
2038    }
2039}
2040
2041/// The `do` keyword.
2042#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
2043#[try_clone(copy)]
2044#[non_exhaustive]
2045pub struct Do {
2046    /// Associated span.
2047    pub span: ast::Span,
2048}
2049
2050impl ast::Spanned for Do {
2051    #[inline]
2052    fn span(&self) -> ast::Span {
2053        self.span
2054    }
2055}
2056
2057impl ast::OptionSpanned for Do {
2058    #[inline]
2059    fn option_span(&self) -> Option<ast::Span> {
2060        Some(self.span)
2061    }
2062}
2063
2064impl ast::ToAst for Do {
2065    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
2066        match kind {
2067            ast::Kind::Do => Ok(Self { span }),
2068            _ => Err(compile::Error::expected(
2069                ast::Token { span, kind },
2070                ast::Kind::Do,
2071            )),
2072        }
2073    }
2074
2075    fn matches(kind: &ast::Kind) -> bool {
2076        match kind {
2077            ast::Kind::Do => true,
2078            _ => false,
2079        }
2080    }
2081
2082    #[inline]
2083    fn into_expectation() -> parse::Expectation {
2084        parse::Expectation::Keyword("do")
2085    }
2086}
2087
2088impl parse::Parse for Do {
2089    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
2090        let token = p.next()?;
2091
2092        match token.kind {
2093            ast::Kind::Do => Ok(Self { span: token.span }),
2094            _ => Err(compile::Error::expected(token, ast::Kind::Do)),
2095        }
2096    }
2097}
2098
2099impl parse::Peek for Do {
2100    #[inline]
2101    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
2102        matches!(peeker.nth(0), ast::Kind::Do)
2103    }
2104}
2105
2106impl macros::ToTokens for Do {
2107    fn to_tokens(
2108        &self,
2109        _: &mut macros::MacroContext<'_, '_, '_>,
2110        stream: &mut macros::TokenStream,
2111    ) -> crate::alloc::Result<()> {
2112        stream.push(ast::Token {
2113            span: self.span,
2114            kind: ast::Kind::Do,
2115        })
2116    }
2117}
2118
2119/// `$`.
2120#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
2121#[try_clone(copy)]
2122#[non_exhaustive]
2123pub struct Dollar {
2124    /// Associated span.
2125    pub span: ast::Span,
2126}
2127
2128impl ast::Spanned for Dollar {
2129    #[inline]
2130    fn span(&self) -> ast::Span {
2131        self.span
2132    }
2133}
2134
2135impl ast::OptionSpanned for Dollar {
2136    #[inline]
2137    fn option_span(&self) -> Option<ast::Span> {
2138        Some(self.span)
2139    }
2140}
2141
2142impl ast::ToAst for Dollar {
2143    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
2144        match kind {
2145            ast::Kind::Dollar => Ok(Self { span }),
2146            _ => Err(compile::Error::expected(
2147                ast::Token { span, kind },
2148                ast::Kind::Dollar,
2149            )),
2150        }
2151    }
2152
2153    fn matches(kind: &ast::Kind) -> bool {
2154        match kind {
2155            ast::Kind::Dollar => true,
2156            _ => false,
2157        }
2158    }
2159
2160    #[inline]
2161    fn into_expectation() -> parse::Expectation {
2162        parse::Expectation::Punctuation("$")
2163    }
2164}
2165
2166impl parse::Parse for Dollar {
2167    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
2168        let token = p.next()?;
2169
2170        match token.kind {
2171            ast::Kind::Dollar => Ok(Self { span: token.span }),
2172            _ => Err(compile::Error::expected(token, ast::Kind::Dollar)),
2173        }
2174    }
2175}
2176
2177impl parse::Peek for Dollar {
2178    #[inline]
2179    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
2180        matches!(peeker.nth(0), ast::Kind::Dollar)
2181    }
2182}
2183
2184impl macros::ToTokens for Dollar {
2185    fn to_tokens(
2186        &self,
2187        _: &mut macros::MacroContext<'_, '_, '_>,
2188        stream: &mut macros::TokenStream,
2189    ) -> crate::alloc::Result<()> {
2190        stream.push(ast::Token {
2191            span: self.span,
2192            kind: ast::Kind::Dollar,
2193        })
2194    }
2195}
2196
2197/// `.`.
2198#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
2199#[try_clone(copy)]
2200#[non_exhaustive]
2201pub struct Dot {
2202    /// Associated span.
2203    pub span: ast::Span,
2204}
2205
2206impl ast::Spanned for Dot {
2207    #[inline]
2208    fn span(&self) -> ast::Span {
2209        self.span
2210    }
2211}
2212
2213impl ast::OptionSpanned for Dot {
2214    #[inline]
2215    fn option_span(&self) -> Option<ast::Span> {
2216        Some(self.span)
2217    }
2218}
2219
2220impl ast::ToAst for Dot {
2221    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
2222        match kind {
2223            ast::Kind::Dot => Ok(Self { span }),
2224            _ => Err(compile::Error::expected(
2225                ast::Token { span, kind },
2226                ast::Kind::Dot,
2227            )),
2228        }
2229    }
2230
2231    fn matches(kind: &ast::Kind) -> bool {
2232        match kind {
2233            ast::Kind::Dot => true,
2234            _ => false,
2235        }
2236    }
2237
2238    #[inline]
2239    fn into_expectation() -> parse::Expectation {
2240        parse::Expectation::Punctuation(".")
2241    }
2242}
2243
2244impl parse::Parse for Dot {
2245    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
2246        let token = p.next()?;
2247
2248        match token.kind {
2249            ast::Kind::Dot => Ok(Self { span: token.span }),
2250            _ => Err(compile::Error::expected(token, ast::Kind::Dot)),
2251        }
2252    }
2253}
2254
2255impl parse::Peek for Dot {
2256    #[inline]
2257    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
2258        matches!(peeker.nth(0), ast::Kind::Dot)
2259    }
2260}
2261
2262impl macros::ToTokens for Dot {
2263    fn to_tokens(
2264        &self,
2265        _: &mut macros::MacroContext<'_, '_, '_>,
2266        stream: &mut macros::TokenStream,
2267    ) -> crate::alloc::Result<()> {
2268        stream.push(ast::Token {
2269            span: self.span,
2270            kind: ast::Kind::Dot,
2271        })
2272    }
2273}
2274
2275/// `..`.
2276#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
2277#[try_clone(copy)]
2278#[non_exhaustive]
2279pub struct DotDot {
2280    /// Associated span.
2281    pub span: ast::Span,
2282}
2283
2284impl ast::Spanned for DotDot {
2285    #[inline]
2286    fn span(&self) -> ast::Span {
2287        self.span
2288    }
2289}
2290
2291impl ast::OptionSpanned for DotDot {
2292    #[inline]
2293    fn option_span(&self) -> Option<ast::Span> {
2294        Some(self.span)
2295    }
2296}
2297
2298impl ast::ToAst for DotDot {
2299    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
2300        match kind {
2301            ast::Kind::DotDot => Ok(Self { span }),
2302            _ => Err(compile::Error::expected(
2303                ast::Token { span, kind },
2304                ast::Kind::DotDot,
2305            )),
2306        }
2307    }
2308
2309    fn matches(kind: &ast::Kind) -> bool {
2310        match kind {
2311            ast::Kind::DotDot => true,
2312            _ => false,
2313        }
2314    }
2315
2316    #[inline]
2317    fn into_expectation() -> parse::Expectation {
2318        parse::Expectation::Punctuation("..")
2319    }
2320}
2321
2322impl parse::Parse for DotDot {
2323    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
2324        let token = p.next()?;
2325
2326        match token.kind {
2327            ast::Kind::DotDot => Ok(Self { span: token.span }),
2328            _ => Err(compile::Error::expected(token, ast::Kind::DotDot)),
2329        }
2330    }
2331}
2332
2333impl parse::Peek for DotDot {
2334    #[inline]
2335    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
2336        matches!(peeker.nth(0), ast::Kind::DotDot)
2337    }
2338}
2339
2340impl macros::ToTokens for DotDot {
2341    fn to_tokens(
2342        &self,
2343        _: &mut macros::MacroContext<'_, '_, '_>,
2344        stream: &mut macros::TokenStream,
2345    ) -> crate::alloc::Result<()> {
2346        stream.push(ast::Token {
2347            span: self.span,
2348            kind: ast::Kind::DotDot,
2349        })
2350    }
2351}
2352
2353/// `..=`.
2354#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
2355#[try_clone(copy)]
2356#[non_exhaustive]
2357pub struct DotDotEq {
2358    /// Associated span.
2359    pub span: ast::Span,
2360}
2361
2362impl ast::Spanned for DotDotEq {
2363    #[inline]
2364    fn span(&self) -> ast::Span {
2365        self.span
2366    }
2367}
2368
2369impl ast::OptionSpanned for DotDotEq {
2370    #[inline]
2371    fn option_span(&self) -> Option<ast::Span> {
2372        Some(self.span)
2373    }
2374}
2375
2376impl ast::ToAst for DotDotEq {
2377    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
2378        match kind {
2379            ast::Kind::DotDotEq => Ok(Self { span }),
2380            _ => Err(compile::Error::expected(
2381                ast::Token { span, kind },
2382                ast::Kind::DotDotEq,
2383            )),
2384        }
2385    }
2386
2387    fn matches(kind: &ast::Kind) -> bool {
2388        match kind {
2389            ast::Kind::DotDotEq => true,
2390            _ => false,
2391        }
2392    }
2393
2394    #[inline]
2395    fn into_expectation() -> parse::Expectation {
2396        parse::Expectation::Punctuation("..=")
2397    }
2398}
2399
2400impl parse::Parse for DotDotEq {
2401    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
2402        let token = p.next()?;
2403
2404        match token.kind {
2405            ast::Kind::DotDotEq => Ok(Self { span: token.span }),
2406            _ => Err(compile::Error::expected(token, ast::Kind::DotDotEq)),
2407        }
2408    }
2409}
2410
2411impl parse::Peek for DotDotEq {
2412    #[inline]
2413    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
2414        matches!(peeker.nth(0), ast::Kind::DotDotEq)
2415    }
2416}
2417
2418impl macros::ToTokens for DotDotEq {
2419    fn to_tokens(
2420        &self,
2421        _: &mut macros::MacroContext<'_, '_, '_>,
2422        stream: &mut macros::TokenStream,
2423    ) -> crate::alloc::Result<()> {
2424        stream.push(ast::Token {
2425            span: self.span,
2426            kind: ast::Kind::DotDotEq,
2427        })
2428    }
2429}
2430
2431/// The `else` keyword.
2432#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
2433#[try_clone(copy)]
2434#[non_exhaustive]
2435pub struct Else {
2436    /// Associated span.
2437    pub span: ast::Span,
2438}
2439
2440impl ast::Spanned for Else {
2441    #[inline]
2442    fn span(&self) -> ast::Span {
2443        self.span
2444    }
2445}
2446
2447impl ast::OptionSpanned for Else {
2448    #[inline]
2449    fn option_span(&self) -> Option<ast::Span> {
2450        Some(self.span)
2451    }
2452}
2453
2454impl ast::ToAst for Else {
2455    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
2456        match kind {
2457            ast::Kind::Else => Ok(Self { span }),
2458            _ => Err(compile::Error::expected(
2459                ast::Token { span, kind },
2460                ast::Kind::Else,
2461            )),
2462        }
2463    }
2464
2465    fn matches(kind: &ast::Kind) -> bool {
2466        match kind {
2467            ast::Kind::Else => true,
2468            _ => false,
2469        }
2470    }
2471
2472    #[inline]
2473    fn into_expectation() -> parse::Expectation {
2474        parse::Expectation::Keyword("else")
2475    }
2476}
2477
2478impl parse::Parse for Else {
2479    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
2480        let token = p.next()?;
2481
2482        match token.kind {
2483            ast::Kind::Else => Ok(Self { span: token.span }),
2484            _ => Err(compile::Error::expected(token, ast::Kind::Else)),
2485        }
2486    }
2487}
2488
2489impl parse::Peek for Else {
2490    #[inline]
2491    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
2492        matches!(peeker.nth(0), ast::Kind::Else)
2493    }
2494}
2495
2496impl macros::ToTokens for Else {
2497    fn to_tokens(
2498        &self,
2499        _: &mut macros::MacroContext<'_, '_, '_>,
2500        stream: &mut macros::TokenStream,
2501    ) -> crate::alloc::Result<()> {
2502        stream.push(ast::Token {
2503            span: self.span,
2504            kind: ast::Kind::Else,
2505        })
2506    }
2507}
2508
2509/// The `enum` keyword.
2510#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
2511#[try_clone(copy)]
2512#[non_exhaustive]
2513pub struct Enum {
2514    /// Associated span.
2515    pub span: ast::Span,
2516}
2517
2518impl ast::Spanned for Enum {
2519    #[inline]
2520    fn span(&self) -> ast::Span {
2521        self.span
2522    }
2523}
2524
2525impl ast::OptionSpanned for Enum {
2526    #[inline]
2527    fn option_span(&self) -> Option<ast::Span> {
2528        Some(self.span)
2529    }
2530}
2531
2532impl ast::ToAst for Enum {
2533    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
2534        match kind {
2535            ast::Kind::Enum => Ok(Self { span }),
2536            _ => Err(compile::Error::expected(
2537                ast::Token { span, kind },
2538                ast::Kind::Enum,
2539            )),
2540        }
2541    }
2542
2543    fn matches(kind: &ast::Kind) -> bool {
2544        match kind {
2545            ast::Kind::Enum => true,
2546            _ => false,
2547        }
2548    }
2549
2550    #[inline]
2551    fn into_expectation() -> parse::Expectation {
2552        parse::Expectation::Keyword("enum")
2553    }
2554}
2555
2556impl parse::Parse for Enum {
2557    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
2558        let token = p.next()?;
2559
2560        match token.kind {
2561            ast::Kind::Enum => Ok(Self { span: token.span }),
2562            _ => Err(compile::Error::expected(token, ast::Kind::Enum)),
2563        }
2564    }
2565}
2566
2567impl parse::Peek for Enum {
2568    #[inline]
2569    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
2570        matches!(peeker.nth(0), ast::Kind::Enum)
2571    }
2572}
2573
2574impl macros::ToTokens for Enum {
2575    fn to_tokens(
2576        &self,
2577        _: &mut macros::MacroContext<'_, '_, '_>,
2578        stream: &mut macros::TokenStream,
2579    ) -> crate::alloc::Result<()> {
2580        stream.push(ast::Token {
2581            span: self.span,
2582            kind: ast::Kind::Enum,
2583        })
2584    }
2585}
2586
2587/// `=`.
2588#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
2589#[try_clone(copy)]
2590#[non_exhaustive]
2591pub struct Eq {
2592    /// Associated span.
2593    pub span: ast::Span,
2594}
2595
2596impl ast::Spanned for Eq {
2597    #[inline]
2598    fn span(&self) -> ast::Span {
2599        self.span
2600    }
2601}
2602
2603impl ast::OptionSpanned for Eq {
2604    #[inline]
2605    fn option_span(&self) -> Option<ast::Span> {
2606        Some(self.span)
2607    }
2608}
2609
2610impl ast::ToAst for Eq {
2611    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
2612        match kind {
2613            ast::Kind::Eq => Ok(Self { span }),
2614            _ => Err(compile::Error::expected(
2615                ast::Token { span, kind },
2616                ast::Kind::Eq,
2617            )),
2618        }
2619    }
2620
2621    fn matches(kind: &ast::Kind) -> bool {
2622        match kind {
2623            ast::Kind::Eq => true,
2624            _ => false,
2625        }
2626    }
2627
2628    #[inline]
2629    fn into_expectation() -> parse::Expectation {
2630        parse::Expectation::Punctuation("=")
2631    }
2632}
2633
2634impl parse::Parse for Eq {
2635    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
2636        let token = p.next()?;
2637
2638        match token.kind {
2639            ast::Kind::Eq => Ok(Self { span: token.span }),
2640            _ => Err(compile::Error::expected(token, ast::Kind::Eq)),
2641        }
2642    }
2643}
2644
2645impl parse::Peek for Eq {
2646    #[inline]
2647    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
2648        matches!(peeker.nth(0), ast::Kind::Eq)
2649    }
2650}
2651
2652impl macros::ToTokens for Eq {
2653    fn to_tokens(
2654        &self,
2655        _: &mut macros::MacroContext<'_, '_, '_>,
2656        stream: &mut macros::TokenStream,
2657    ) -> crate::alloc::Result<()> {
2658        stream.push(ast::Token {
2659            span: self.span,
2660            kind: ast::Kind::Eq,
2661        })
2662    }
2663}
2664
2665/// `==`.
2666#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
2667#[try_clone(copy)]
2668#[non_exhaustive]
2669pub struct EqEq {
2670    /// Associated span.
2671    pub span: ast::Span,
2672}
2673
2674impl ast::Spanned for EqEq {
2675    #[inline]
2676    fn span(&self) -> ast::Span {
2677        self.span
2678    }
2679}
2680
2681impl ast::OptionSpanned for EqEq {
2682    #[inline]
2683    fn option_span(&self) -> Option<ast::Span> {
2684        Some(self.span)
2685    }
2686}
2687
2688impl ast::ToAst for EqEq {
2689    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
2690        match kind {
2691            ast::Kind::EqEq => Ok(Self { span }),
2692            _ => Err(compile::Error::expected(
2693                ast::Token { span, kind },
2694                ast::Kind::EqEq,
2695            )),
2696        }
2697    }
2698
2699    fn matches(kind: &ast::Kind) -> bool {
2700        match kind {
2701            ast::Kind::EqEq => true,
2702            _ => false,
2703        }
2704    }
2705
2706    #[inline]
2707    fn into_expectation() -> parse::Expectation {
2708        parse::Expectation::Punctuation("==")
2709    }
2710}
2711
2712impl parse::Parse for EqEq {
2713    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
2714        let token = p.next()?;
2715
2716        match token.kind {
2717            ast::Kind::EqEq => Ok(Self { span: token.span }),
2718            _ => Err(compile::Error::expected(token, ast::Kind::EqEq)),
2719        }
2720    }
2721}
2722
2723impl parse::Peek for EqEq {
2724    #[inline]
2725    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
2726        matches!(peeker.nth(0), ast::Kind::EqEq)
2727    }
2728}
2729
2730impl macros::ToTokens for EqEq {
2731    fn to_tokens(
2732        &self,
2733        _: &mut macros::MacroContext<'_, '_, '_>,
2734        stream: &mut macros::TokenStream,
2735    ) -> crate::alloc::Result<()> {
2736        stream.push(ast::Token {
2737            span: self.span,
2738            kind: ast::Kind::EqEq,
2739        })
2740    }
2741}
2742
2743/// The `extern` keyword.
2744#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
2745#[try_clone(copy)]
2746#[non_exhaustive]
2747pub struct Extern {
2748    /// Associated span.
2749    pub span: ast::Span,
2750}
2751
2752impl ast::Spanned for Extern {
2753    #[inline]
2754    fn span(&self) -> ast::Span {
2755        self.span
2756    }
2757}
2758
2759impl ast::OptionSpanned for Extern {
2760    #[inline]
2761    fn option_span(&self) -> Option<ast::Span> {
2762        Some(self.span)
2763    }
2764}
2765
2766impl ast::ToAst for Extern {
2767    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
2768        match kind {
2769            ast::Kind::Extern => Ok(Self { span }),
2770            _ => Err(compile::Error::expected(
2771                ast::Token { span, kind },
2772                ast::Kind::Extern,
2773            )),
2774        }
2775    }
2776
2777    fn matches(kind: &ast::Kind) -> bool {
2778        match kind {
2779            ast::Kind::Extern => true,
2780            _ => false,
2781        }
2782    }
2783
2784    #[inline]
2785    fn into_expectation() -> parse::Expectation {
2786        parse::Expectation::Keyword("extern")
2787    }
2788}
2789
2790impl parse::Parse for Extern {
2791    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
2792        let token = p.next()?;
2793
2794        match token.kind {
2795            ast::Kind::Extern => Ok(Self { span: token.span }),
2796            _ => Err(compile::Error::expected(token, ast::Kind::Extern)),
2797        }
2798    }
2799}
2800
2801impl parse::Peek for Extern {
2802    #[inline]
2803    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
2804        matches!(peeker.nth(0), ast::Kind::Extern)
2805    }
2806}
2807
2808impl macros::ToTokens for Extern {
2809    fn to_tokens(
2810        &self,
2811        _: &mut macros::MacroContext<'_, '_, '_>,
2812        stream: &mut macros::TokenStream,
2813    ) -> crate::alloc::Result<()> {
2814        stream.push(ast::Token {
2815            span: self.span,
2816            kind: ast::Kind::Extern,
2817        })
2818    }
2819}
2820
2821/// The `false` keyword.
2822#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
2823#[try_clone(copy)]
2824#[non_exhaustive]
2825pub struct False {
2826    /// Associated span.
2827    pub span: ast::Span,
2828}
2829
2830impl ast::Spanned for False {
2831    #[inline]
2832    fn span(&self) -> ast::Span {
2833        self.span
2834    }
2835}
2836
2837impl ast::OptionSpanned for False {
2838    #[inline]
2839    fn option_span(&self) -> Option<ast::Span> {
2840        Some(self.span)
2841    }
2842}
2843
2844impl ast::ToAst for False {
2845    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
2846        match kind {
2847            ast::Kind::False => Ok(Self { span }),
2848            _ => Err(compile::Error::expected(
2849                ast::Token { span, kind },
2850                ast::Kind::False,
2851            )),
2852        }
2853    }
2854
2855    fn matches(kind: &ast::Kind) -> bool {
2856        match kind {
2857            ast::Kind::False => true,
2858            _ => false,
2859        }
2860    }
2861
2862    #[inline]
2863    fn into_expectation() -> parse::Expectation {
2864        parse::Expectation::Keyword("false")
2865    }
2866}
2867
2868impl parse::Parse for False {
2869    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
2870        let token = p.next()?;
2871
2872        match token.kind {
2873            ast::Kind::False => Ok(Self { span: token.span }),
2874            _ => Err(compile::Error::expected(token, ast::Kind::False)),
2875        }
2876    }
2877}
2878
2879impl parse::Peek for False {
2880    #[inline]
2881    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
2882        matches!(peeker.nth(0), ast::Kind::False)
2883    }
2884}
2885
2886impl macros::ToTokens for False {
2887    fn to_tokens(
2888        &self,
2889        _: &mut macros::MacroContext<'_, '_, '_>,
2890        stream: &mut macros::TokenStream,
2891    ) -> crate::alloc::Result<()> {
2892        stream.push(ast::Token {
2893            span: self.span,
2894            kind: ast::Kind::False,
2895        })
2896    }
2897}
2898
2899/// The `final` keyword.
2900#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
2901#[try_clone(copy)]
2902#[non_exhaustive]
2903pub struct Final {
2904    /// Associated span.
2905    pub span: ast::Span,
2906}
2907
2908impl ast::Spanned for Final {
2909    #[inline]
2910    fn span(&self) -> ast::Span {
2911        self.span
2912    }
2913}
2914
2915impl ast::OptionSpanned for Final {
2916    #[inline]
2917    fn option_span(&self) -> Option<ast::Span> {
2918        Some(self.span)
2919    }
2920}
2921
2922impl ast::ToAst for Final {
2923    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
2924        match kind {
2925            ast::Kind::Final => Ok(Self { span }),
2926            _ => Err(compile::Error::expected(
2927                ast::Token { span, kind },
2928                ast::Kind::Final,
2929            )),
2930        }
2931    }
2932
2933    fn matches(kind: &ast::Kind) -> bool {
2934        match kind {
2935            ast::Kind::Final => true,
2936            _ => false,
2937        }
2938    }
2939
2940    #[inline]
2941    fn into_expectation() -> parse::Expectation {
2942        parse::Expectation::Keyword("final")
2943    }
2944}
2945
2946impl parse::Parse for Final {
2947    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
2948        let token = p.next()?;
2949
2950        match token.kind {
2951            ast::Kind::Final => Ok(Self { span: token.span }),
2952            _ => Err(compile::Error::expected(token, ast::Kind::Final)),
2953        }
2954    }
2955}
2956
2957impl parse::Peek for Final {
2958    #[inline]
2959    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
2960        matches!(peeker.nth(0), ast::Kind::Final)
2961    }
2962}
2963
2964impl macros::ToTokens for Final {
2965    fn to_tokens(
2966        &self,
2967        _: &mut macros::MacroContext<'_, '_, '_>,
2968        stream: &mut macros::TokenStream,
2969    ) -> crate::alloc::Result<()> {
2970        stream.push(ast::Token {
2971            span: self.span,
2972            kind: ast::Kind::Final,
2973        })
2974    }
2975}
2976
2977/// The `fn` keyword.
2978#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
2979#[try_clone(copy)]
2980#[non_exhaustive]
2981pub struct Fn {
2982    /// Associated span.
2983    pub span: ast::Span,
2984}
2985
2986impl ast::Spanned for Fn {
2987    #[inline]
2988    fn span(&self) -> ast::Span {
2989        self.span
2990    }
2991}
2992
2993impl ast::OptionSpanned for Fn {
2994    #[inline]
2995    fn option_span(&self) -> Option<ast::Span> {
2996        Some(self.span)
2997    }
2998}
2999
3000impl ast::ToAst for Fn {
3001    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
3002        match kind {
3003            ast::Kind::Fn => Ok(Self { span }),
3004            _ => Err(compile::Error::expected(
3005                ast::Token { span, kind },
3006                ast::Kind::Fn,
3007            )),
3008        }
3009    }
3010
3011    fn matches(kind: &ast::Kind) -> bool {
3012        match kind {
3013            ast::Kind::Fn => true,
3014            _ => false,
3015        }
3016    }
3017
3018    #[inline]
3019    fn into_expectation() -> parse::Expectation {
3020        parse::Expectation::Keyword("fn")
3021    }
3022}
3023
3024impl parse::Parse for Fn {
3025    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
3026        let token = p.next()?;
3027
3028        match token.kind {
3029            ast::Kind::Fn => Ok(Self { span: token.span }),
3030            _ => Err(compile::Error::expected(token, ast::Kind::Fn)),
3031        }
3032    }
3033}
3034
3035impl parse::Peek for Fn {
3036    #[inline]
3037    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
3038        matches!(peeker.nth(0), ast::Kind::Fn)
3039    }
3040}
3041
3042impl macros::ToTokens for Fn {
3043    fn to_tokens(
3044        &self,
3045        _: &mut macros::MacroContext<'_, '_, '_>,
3046        stream: &mut macros::TokenStream,
3047    ) -> crate::alloc::Result<()> {
3048        stream.push(ast::Token {
3049            span: self.span,
3050            kind: ast::Kind::Fn,
3051        })
3052    }
3053}
3054
3055/// The `for` keyword.
3056#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
3057#[try_clone(copy)]
3058#[non_exhaustive]
3059pub struct For {
3060    /// Associated span.
3061    pub span: ast::Span,
3062}
3063
3064impl ast::Spanned for For {
3065    #[inline]
3066    fn span(&self) -> ast::Span {
3067        self.span
3068    }
3069}
3070
3071impl ast::OptionSpanned for For {
3072    #[inline]
3073    fn option_span(&self) -> Option<ast::Span> {
3074        Some(self.span)
3075    }
3076}
3077
3078impl ast::ToAst for For {
3079    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
3080        match kind {
3081            ast::Kind::For => Ok(Self { span }),
3082            _ => Err(compile::Error::expected(
3083                ast::Token { span, kind },
3084                ast::Kind::For,
3085            )),
3086        }
3087    }
3088
3089    fn matches(kind: &ast::Kind) -> bool {
3090        match kind {
3091            ast::Kind::For => true,
3092            _ => false,
3093        }
3094    }
3095
3096    #[inline]
3097    fn into_expectation() -> parse::Expectation {
3098        parse::Expectation::Keyword("for")
3099    }
3100}
3101
3102impl parse::Parse for For {
3103    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
3104        let token = p.next()?;
3105
3106        match token.kind {
3107            ast::Kind::For => Ok(Self { span: token.span }),
3108            _ => Err(compile::Error::expected(token, ast::Kind::For)),
3109        }
3110    }
3111}
3112
3113impl parse::Peek for For {
3114    #[inline]
3115    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
3116        matches!(peeker.nth(0), ast::Kind::For)
3117    }
3118}
3119
3120impl macros::ToTokens for For {
3121    fn to_tokens(
3122        &self,
3123        _: &mut macros::MacroContext<'_, '_, '_>,
3124        stream: &mut macros::TokenStream,
3125    ) -> crate::alloc::Result<()> {
3126        stream.push(ast::Token {
3127            span: self.span,
3128            kind: ast::Kind::For,
3129        })
3130    }
3131}
3132
3133/// `>`.
3134#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
3135#[try_clone(copy)]
3136#[non_exhaustive]
3137pub struct Gt {
3138    /// Associated span.
3139    pub span: ast::Span,
3140}
3141
3142impl ast::Spanned for Gt {
3143    #[inline]
3144    fn span(&self) -> ast::Span {
3145        self.span
3146    }
3147}
3148
3149impl ast::OptionSpanned for Gt {
3150    #[inline]
3151    fn option_span(&self) -> Option<ast::Span> {
3152        Some(self.span)
3153    }
3154}
3155
3156impl ast::ToAst for Gt {
3157    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
3158        match kind {
3159            ast::Kind::Gt => Ok(Self { span }),
3160            _ => Err(compile::Error::expected(
3161                ast::Token { span, kind },
3162                ast::Kind::Gt,
3163            )),
3164        }
3165    }
3166
3167    fn matches(kind: &ast::Kind) -> bool {
3168        match kind {
3169            ast::Kind::Gt => true,
3170            _ => false,
3171        }
3172    }
3173
3174    #[inline]
3175    fn into_expectation() -> parse::Expectation {
3176        parse::Expectation::Punctuation(">")
3177    }
3178}
3179
3180impl parse::Parse for Gt {
3181    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
3182        let token = p.next()?;
3183
3184        match token.kind {
3185            ast::Kind::Gt => Ok(Self { span: token.span }),
3186            _ => Err(compile::Error::expected(token, ast::Kind::Gt)),
3187        }
3188    }
3189}
3190
3191impl parse::Peek for Gt {
3192    #[inline]
3193    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
3194        matches!(peeker.nth(0), ast::Kind::Gt)
3195    }
3196}
3197
3198impl macros::ToTokens for Gt {
3199    fn to_tokens(
3200        &self,
3201        _: &mut macros::MacroContext<'_, '_, '_>,
3202        stream: &mut macros::TokenStream,
3203    ) -> crate::alloc::Result<()> {
3204        stream.push(ast::Token {
3205            span: self.span,
3206            kind: ast::Kind::Gt,
3207        })
3208    }
3209}
3210
3211/// `>=`.
3212#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
3213#[try_clone(copy)]
3214#[non_exhaustive]
3215pub struct GtEq {
3216    /// Associated span.
3217    pub span: ast::Span,
3218}
3219
3220impl ast::Spanned for GtEq {
3221    #[inline]
3222    fn span(&self) -> ast::Span {
3223        self.span
3224    }
3225}
3226
3227impl ast::OptionSpanned for GtEq {
3228    #[inline]
3229    fn option_span(&self) -> Option<ast::Span> {
3230        Some(self.span)
3231    }
3232}
3233
3234impl ast::ToAst for GtEq {
3235    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
3236        match kind {
3237            ast::Kind::GtEq => Ok(Self { span }),
3238            _ => Err(compile::Error::expected(
3239                ast::Token { span, kind },
3240                ast::Kind::GtEq,
3241            )),
3242        }
3243    }
3244
3245    fn matches(kind: &ast::Kind) -> bool {
3246        match kind {
3247            ast::Kind::GtEq => true,
3248            _ => false,
3249        }
3250    }
3251
3252    #[inline]
3253    fn into_expectation() -> parse::Expectation {
3254        parse::Expectation::Punctuation(">=")
3255    }
3256}
3257
3258impl parse::Parse for GtEq {
3259    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
3260        let token = p.next()?;
3261
3262        match token.kind {
3263            ast::Kind::GtEq => Ok(Self { span: token.span }),
3264            _ => Err(compile::Error::expected(token, ast::Kind::GtEq)),
3265        }
3266    }
3267}
3268
3269impl parse::Peek for GtEq {
3270    #[inline]
3271    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
3272        matches!(peeker.nth(0), ast::Kind::GtEq)
3273    }
3274}
3275
3276impl macros::ToTokens for GtEq {
3277    fn to_tokens(
3278        &self,
3279        _: &mut macros::MacroContext<'_, '_, '_>,
3280        stream: &mut macros::TokenStream,
3281    ) -> crate::alloc::Result<()> {
3282        stream.push(ast::Token {
3283            span: self.span,
3284            kind: ast::Kind::GtEq,
3285        })
3286    }
3287}
3288
3289/// `>>`.
3290#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
3291#[try_clone(copy)]
3292#[non_exhaustive]
3293pub struct GtGt {
3294    /// Associated span.
3295    pub span: ast::Span,
3296}
3297
3298impl ast::Spanned for GtGt {
3299    #[inline]
3300    fn span(&self) -> ast::Span {
3301        self.span
3302    }
3303}
3304
3305impl ast::OptionSpanned for GtGt {
3306    #[inline]
3307    fn option_span(&self) -> Option<ast::Span> {
3308        Some(self.span)
3309    }
3310}
3311
3312impl ast::ToAst for GtGt {
3313    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
3314        match kind {
3315            ast::Kind::GtGt => Ok(Self { span }),
3316            _ => Err(compile::Error::expected(
3317                ast::Token { span, kind },
3318                ast::Kind::GtGt,
3319            )),
3320        }
3321    }
3322
3323    fn matches(kind: &ast::Kind) -> bool {
3324        match kind {
3325            ast::Kind::GtGt => true,
3326            _ => false,
3327        }
3328    }
3329
3330    #[inline]
3331    fn into_expectation() -> parse::Expectation {
3332        parse::Expectation::Punctuation(">>")
3333    }
3334}
3335
3336impl parse::Parse for GtGt {
3337    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
3338        let token = p.next()?;
3339
3340        match token.kind {
3341            ast::Kind::GtGt => Ok(Self { span: token.span }),
3342            _ => Err(compile::Error::expected(token, ast::Kind::GtGt)),
3343        }
3344    }
3345}
3346
3347impl parse::Peek for GtGt {
3348    #[inline]
3349    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
3350        matches!(peeker.nth(0), ast::Kind::GtGt)
3351    }
3352}
3353
3354impl macros::ToTokens for GtGt {
3355    fn to_tokens(
3356        &self,
3357        _: &mut macros::MacroContext<'_, '_, '_>,
3358        stream: &mut macros::TokenStream,
3359    ) -> crate::alloc::Result<()> {
3360        stream.push(ast::Token {
3361            span: self.span,
3362            kind: ast::Kind::GtGt,
3363        })
3364    }
3365}
3366
3367/// `>>=`.
3368#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
3369#[try_clone(copy)]
3370#[non_exhaustive]
3371pub struct GtGtEq {
3372    /// Associated span.
3373    pub span: ast::Span,
3374}
3375
3376impl ast::Spanned for GtGtEq {
3377    #[inline]
3378    fn span(&self) -> ast::Span {
3379        self.span
3380    }
3381}
3382
3383impl ast::OptionSpanned for GtGtEq {
3384    #[inline]
3385    fn option_span(&self) -> Option<ast::Span> {
3386        Some(self.span)
3387    }
3388}
3389
3390impl ast::ToAst for GtGtEq {
3391    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
3392        match kind {
3393            ast::Kind::GtGtEq => Ok(Self { span }),
3394            _ => Err(compile::Error::expected(
3395                ast::Token { span, kind },
3396                ast::Kind::GtGtEq,
3397            )),
3398        }
3399    }
3400
3401    fn matches(kind: &ast::Kind) -> bool {
3402        match kind {
3403            ast::Kind::GtGtEq => true,
3404            _ => false,
3405        }
3406    }
3407
3408    #[inline]
3409    fn into_expectation() -> parse::Expectation {
3410        parse::Expectation::Punctuation(">>=")
3411    }
3412}
3413
3414impl parse::Parse for GtGtEq {
3415    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
3416        let token = p.next()?;
3417
3418        match token.kind {
3419            ast::Kind::GtGtEq => Ok(Self { span: token.span }),
3420            _ => Err(compile::Error::expected(token, ast::Kind::GtGtEq)),
3421        }
3422    }
3423}
3424
3425impl parse::Peek for GtGtEq {
3426    #[inline]
3427    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
3428        matches!(peeker.nth(0), ast::Kind::GtGtEq)
3429    }
3430}
3431
3432impl macros::ToTokens for GtGtEq {
3433    fn to_tokens(
3434        &self,
3435        _: &mut macros::MacroContext<'_, '_, '_>,
3436        stream: &mut macros::TokenStream,
3437    ) -> crate::alloc::Result<()> {
3438        stream.push(ast::Token {
3439            span: self.span,
3440            kind: ast::Kind::GtGtEq,
3441        })
3442    }
3443}
3444
3445/// The `if` keyword.
3446#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
3447#[try_clone(copy)]
3448#[non_exhaustive]
3449pub struct If {
3450    /// Associated span.
3451    pub span: ast::Span,
3452}
3453
3454impl ast::Spanned for If {
3455    #[inline]
3456    fn span(&self) -> ast::Span {
3457        self.span
3458    }
3459}
3460
3461impl ast::OptionSpanned for If {
3462    #[inline]
3463    fn option_span(&self) -> Option<ast::Span> {
3464        Some(self.span)
3465    }
3466}
3467
3468impl ast::ToAst for If {
3469    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
3470        match kind {
3471            ast::Kind::If => Ok(Self { span }),
3472            _ => Err(compile::Error::expected(
3473                ast::Token { span, kind },
3474                ast::Kind::If,
3475            )),
3476        }
3477    }
3478
3479    fn matches(kind: &ast::Kind) -> bool {
3480        match kind {
3481            ast::Kind::If => true,
3482            _ => false,
3483        }
3484    }
3485
3486    #[inline]
3487    fn into_expectation() -> parse::Expectation {
3488        parse::Expectation::Keyword("if")
3489    }
3490}
3491
3492impl parse::Parse for If {
3493    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
3494        let token = p.next()?;
3495
3496        match token.kind {
3497            ast::Kind::If => Ok(Self { span: token.span }),
3498            _ => Err(compile::Error::expected(token, ast::Kind::If)),
3499        }
3500    }
3501}
3502
3503impl parse::Peek for If {
3504    #[inline]
3505    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
3506        matches!(peeker.nth(0), ast::Kind::If)
3507    }
3508}
3509
3510impl macros::ToTokens for If {
3511    fn to_tokens(
3512        &self,
3513        _: &mut macros::MacroContext<'_, '_, '_>,
3514        stream: &mut macros::TokenStream,
3515    ) -> crate::alloc::Result<()> {
3516        stream.push(ast::Token {
3517            span: self.span,
3518            kind: ast::Kind::If,
3519        })
3520    }
3521}
3522
3523/// The `impl` keyword.
3524#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
3525#[try_clone(copy)]
3526#[non_exhaustive]
3527pub struct Impl {
3528    /// Associated span.
3529    pub span: ast::Span,
3530}
3531
3532impl ast::Spanned for Impl {
3533    #[inline]
3534    fn span(&self) -> ast::Span {
3535        self.span
3536    }
3537}
3538
3539impl ast::OptionSpanned for Impl {
3540    #[inline]
3541    fn option_span(&self) -> Option<ast::Span> {
3542        Some(self.span)
3543    }
3544}
3545
3546impl ast::ToAst for Impl {
3547    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
3548        match kind {
3549            ast::Kind::Impl => Ok(Self { span }),
3550            _ => Err(compile::Error::expected(
3551                ast::Token { span, kind },
3552                ast::Kind::Impl,
3553            )),
3554        }
3555    }
3556
3557    fn matches(kind: &ast::Kind) -> bool {
3558        match kind {
3559            ast::Kind::Impl => true,
3560            _ => false,
3561        }
3562    }
3563
3564    #[inline]
3565    fn into_expectation() -> parse::Expectation {
3566        parse::Expectation::Keyword("impl")
3567    }
3568}
3569
3570impl parse::Parse for Impl {
3571    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
3572        let token = p.next()?;
3573
3574        match token.kind {
3575            ast::Kind::Impl => Ok(Self { span: token.span }),
3576            _ => Err(compile::Error::expected(token, ast::Kind::Impl)),
3577        }
3578    }
3579}
3580
3581impl parse::Peek for Impl {
3582    #[inline]
3583    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
3584        matches!(peeker.nth(0), ast::Kind::Impl)
3585    }
3586}
3587
3588impl macros::ToTokens for Impl {
3589    fn to_tokens(
3590        &self,
3591        _: &mut macros::MacroContext<'_, '_, '_>,
3592        stream: &mut macros::TokenStream,
3593    ) -> crate::alloc::Result<()> {
3594        stream.push(ast::Token {
3595            span: self.span,
3596            kind: ast::Kind::Impl,
3597        })
3598    }
3599}
3600
3601/// The `in` keyword.
3602#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
3603#[try_clone(copy)]
3604#[non_exhaustive]
3605pub struct In {
3606    /// Associated span.
3607    pub span: ast::Span,
3608}
3609
3610impl ast::Spanned for In {
3611    #[inline]
3612    fn span(&self) -> ast::Span {
3613        self.span
3614    }
3615}
3616
3617impl ast::OptionSpanned for In {
3618    #[inline]
3619    fn option_span(&self) -> Option<ast::Span> {
3620        Some(self.span)
3621    }
3622}
3623
3624impl ast::ToAst for In {
3625    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
3626        match kind {
3627            ast::Kind::In => Ok(Self { span }),
3628            _ => Err(compile::Error::expected(
3629                ast::Token { span, kind },
3630                ast::Kind::In,
3631            )),
3632        }
3633    }
3634
3635    fn matches(kind: &ast::Kind) -> bool {
3636        match kind {
3637            ast::Kind::In => true,
3638            _ => false,
3639        }
3640    }
3641
3642    #[inline]
3643    fn into_expectation() -> parse::Expectation {
3644        parse::Expectation::Keyword("in")
3645    }
3646}
3647
3648impl parse::Parse for In {
3649    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
3650        let token = p.next()?;
3651
3652        match token.kind {
3653            ast::Kind::In => Ok(Self { span: token.span }),
3654            _ => Err(compile::Error::expected(token, ast::Kind::In)),
3655        }
3656    }
3657}
3658
3659impl parse::Peek for In {
3660    #[inline]
3661    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
3662        matches!(peeker.nth(0), ast::Kind::In)
3663    }
3664}
3665
3666impl macros::ToTokens for In {
3667    fn to_tokens(
3668        &self,
3669        _: &mut macros::MacroContext<'_, '_, '_>,
3670        stream: &mut macros::TokenStream,
3671    ) -> crate::alloc::Result<()> {
3672        stream.push(ast::Token {
3673            span: self.span,
3674            kind: ast::Kind::In,
3675        })
3676    }
3677}
3678
3679/// The `is` keyword.
3680#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
3681#[try_clone(copy)]
3682#[non_exhaustive]
3683pub struct Is {
3684    /// Associated span.
3685    pub span: ast::Span,
3686}
3687
3688impl ast::Spanned for Is {
3689    #[inline]
3690    fn span(&self) -> ast::Span {
3691        self.span
3692    }
3693}
3694
3695impl ast::OptionSpanned for Is {
3696    #[inline]
3697    fn option_span(&self) -> Option<ast::Span> {
3698        Some(self.span)
3699    }
3700}
3701
3702impl ast::ToAst for Is {
3703    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
3704        match kind {
3705            ast::Kind::Is => Ok(Self { span }),
3706            _ => Err(compile::Error::expected(
3707                ast::Token { span, kind },
3708                ast::Kind::Is,
3709            )),
3710        }
3711    }
3712
3713    fn matches(kind: &ast::Kind) -> bool {
3714        match kind {
3715            ast::Kind::Is => true,
3716            _ => false,
3717        }
3718    }
3719
3720    #[inline]
3721    fn into_expectation() -> parse::Expectation {
3722        parse::Expectation::Keyword("is")
3723    }
3724}
3725
3726impl parse::Parse for Is {
3727    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
3728        let token = p.next()?;
3729
3730        match token.kind {
3731            ast::Kind::Is => Ok(Self { span: token.span }),
3732            _ => Err(compile::Error::expected(token, ast::Kind::Is)),
3733        }
3734    }
3735}
3736
3737impl parse::Peek for Is {
3738    #[inline]
3739    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
3740        matches!(peeker.nth(0), ast::Kind::Is)
3741    }
3742}
3743
3744impl macros::ToTokens for Is {
3745    fn to_tokens(
3746        &self,
3747        _: &mut macros::MacroContext<'_, '_, '_>,
3748        stream: &mut macros::TokenStream,
3749    ) -> crate::alloc::Result<()> {
3750        stream.push(ast::Token {
3751            span: self.span,
3752            kind: ast::Kind::Is,
3753        })
3754    }
3755}
3756
3757/// The `let` keyword.
3758#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
3759#[try_clone(copy)]
3760#[non_exhaustive]
3761pub struct Let {
3762    /// Associated span.
3763    pub span: ast::Span,
3764}
3765
3766impl ast::Spanned for Let {
3767    #[inline]
3768    fn span(&self) -> ast::Span {
3769        self.span
3770    }
3771}
3772
3773impl ast::OptionSpanned for Let {
3774    #[inline]
3775    fn option_span(&self) -> Option<ast::Span> {
3776        Some(self.span)
3777    }
3778}
3779
3780impl ast::ToAst for Let {
3781    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
3782        match kind {
3783            ast::Kind::Let => Ok(Self { span }),
3784            _ => Err(compile::Error::expected(
3785                ast::Token { span, kind },
3786                ast::Kind::Let,
3787            )),
3788        }
3789    }
3790
3791    fn matches(kind: &ast::Kind) -> bool {
3792        match kind {
3793            ast::Kind::Let => true,
3794            _ => false,
3795        }
3796    }
3797
3798    #[inline]
3799    fn into_expectation() -> parse::Expectation {
3800        parse::Expectation::Keyword("let")
3801    }
3802}
3803
3804impl parse::Parse for Let {
3805    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
3806        let token = p.next()?;
3807
3808        match token.kind {
3809            ast::Kind::Let => Ok(Self { span: token.span }),
3810            _ => Err(compile::Error::expected(token, ast::Kind::Let)),
3811        }
3812    }
3813}
3814
3815impl parse::Peek for Let {
3816    #[inline]
3817    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
3818        matches!(peeker.nth(0), ast::Kind::Let)
3819    }
3820}
3821
3822impl macros::ToTokens for Let {
3823    fn to_tokens(
3824        &self,
3825        _: &mut macros::MacroContext<'_, '_, '_>,
3826        stream: &mut macros::TokenStream,
3827    ) -> crate::alloc::Result<()> {
3828        stream.push(ast::Token {
3829            span: self.span,
3830            kind: ast::Kind::Let,
3831        })
3832    }
3833}
3834
3835/// The `loop` keyword.
3836#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
3837#[try_clone(copy)]
3838#[non_exhaustive]
3839pub struct Loop {
3840    /// Associated span.
3841    pub span: ast::Span,
3842}
3843
3844impl ast::Spanned for Loop {
3845    #[inline]
3846    fn span(&self) -> ast::Span {
3847        self.span
3848    }
3849}
3850
3851impl ast::OptionSpanned for Loop {
3852    #[inline]
3853    fn option_span(&self) -> Option<ast::Span> {
3854        Some(self.span)
3855    }
3856}
3857
3858impl ast::ToAst for Loop {
3859    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
3860        match kind {
3861            ast::Kind::Loop => Ok(Self { span }),
3862            _ => Err(compile::Error::expected(
3863                ast::Token { span, kind },
3864                ast::Kind::Loop,
3865            )),
3866        }
3867    }
3868
3869    fn matches(kind: &ast::Kind) -> bool {
3870        match kind {
3871            ast::Kind::Loop => true,
3872            _ => false,
3873        }
3874    }
3875
3876    #[inline]
3877    fn into_expectation() -> parse::Expectation {
3878        parse::Expectation::Keyword("loop")
3879    }
3880}
3881
3882impl parse::Parse for Loop {
3883    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
3884        let token = p.next()?;
3885
3886        match token.kind {
3887            ast::Kind::Loop => Ok(Self { span: token.span }),
3888            _ => Err(compile::Error::expected(token, ast::Kind::Loop)),
3889        }
3890    }
3891}
3892
3893impl parse::Peek for Loop {
3894    #[inline]
3895    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
3896        matches!(peeker.nth(0), ast::Kind::Loop)
3897    }
3898}
3899
3900impl macros::ToTokens for Loop {
3901    fn to_tokens(
3902        &self,
3903        _: &mut macros::MacroContext<'_, '_, '_>,
3904        stream: &mut macros::TokenStream,
3905    ) -> crate::alloc::Result<()> {
3906        stream.push(ast::Token {
3907            span: self.span,
3908            kind: ast::Kind::Loop,
3909        })
3910    }
3911}
3912
3913/// `<`.
3914#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
3915#[try_clone(copy)]
3916#[non_exhaustive]
3917pub struct Lt {
3918    /// Associated span.
3919    pub span: ast::Span,
3920}
3921
3922impl ast::Spanned for Lt {
3923    #[inline]
3924    fn span(&self) -> ast::Span {
3925        self.span
3926    }
3927}
3928
3929impl ast::OptionSpanned for Lt {
3930    #[inline]
3931    fn option_span(&self) -> Option<ast::Span> {
3932        Some(self.span)
3933    }
3934}
3935
3936impl ast::ToAst for Lt {
3937    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
3938        match kind {
3939            ast::Kind::Lt => Ok(Self { span }),
3940            _ => Err(compile::Error::expected(
3941                ast::Token { span, kind },
3942                ast::Kind::Lt,
3943            )),
3944        }
3945    }
3946
3947    fn matches(kind: &ast::Kind) -> bool {
3948        match kind {
3949            ast::Kind::Lt => true,
3950            _ => false,
3951        }
3952    }
3953
3954    #[inline]
3955    fn into_expectation() -> parse::Expectation {
3956        parse::Expectation::Punctuation("<")
3957    }
3958}
3959
3960impl parse::Parse for Lt {
3961    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
3962        let token = p.next()?;
3963
3964        match token.kind {
3965            ast::Kind::Lt => Ok(Self { span: token.span }),
3966            _ => Err(compile::Error::expected(token, ast::Kind::Lt)),
3967        }
3968    }
3969}
3970
3971impl parse::Peek for Lt {
3972    #[inline]
3973    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
3974        matches!(peeker.nth(0), ast::Kind::Lt)
3975    }
3976}
3977
3978impl macros::ToTokens for Lt {
3979    fn to_tokens(
3980        &self,
3981        _: &mut macros::MacroContext<'_, '_, '_>,
3982        stream: &mut macros::TokenStream,
3983    ) -> crate::alloc::Result<()> {
3984        stream.push(ast::Token {
3985            span: self.span,
3986            kind: ast::Kind::Lt,
3987        })
3988    }
3989}
3990
3991/// `<=`.
3992#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
3993#[try_clone(copy)]
3994#[non_exhaustive]
3995pub struct LtEq {
3996    /// Associated span.
3997    pub span: ast::Span,
3998}
3999
4000impl ast::Spanned for LtEq {
4001    #[inline]
4002    fn span(&self) -> ast::Span {
4003        self.span
4004    }
4005}
4006
4007impl ast::OptionSpanned for LtEq {
4008    #[inline]
4009    fn option_span(&self) -> Option<ast::Span> {
4010        Some(self.span)
4011    }
4012}
4013
4014impl ast::ToAst for LtEq {
4015    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
4016        match kind {
4017            ast::Kind::LtEq => Ok(Self { span }),
4018            _ => Err(compile::Error::expected(
4019                ast::Token { span, kind },
4020                ast::Kind::LtEq,
4021            )),
4022        }
4023    }
4024
4025    fn matches(kind: &ast::Kind) -> bool {
4026        match kind {
4027            ast::Kind::LtEq => true,
4028            _ => false,
4029        }
4030    }
4031
4032    #[inline]
4033    fn into_expectation() -> parse::Expectation {
4034        parse::Expectation::Punctuation("<=")
4035    }
4036}
4037
4038impl parse::Parse for LtEq {
4039    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
4040        let token = p.next()?;
4041
4042        match token.kind {
4043            ast::Kind::LtEq => Ok(Self { span: token.span }),
4044            _ => Err(compile::Error::expected(token, ast::Kind::LtEq)),
4045        }
4046    }
4047}
4048
4049impl parse::Peek for LtEq {
4050    #[inline]
4051    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
4052        matches!(peeker.nth(0), ast::Kind::LtEq)
4053    }
4054}
4055
4056impl macros::ToTokens for LtEq {
4057    fn to_tokens(
4058        &self,
4059        _: &mut macros::MacroContext<'_, '_, '_>,
4060        stream: &mut macros::TokenStream,
4061    ) -> crate::alloc::Result<()> {
4062        stream.push(ast::Token {
4063            span: self.span,
4064            kind: ast::Kind::LtEq,
4065        })
4066    }
4067}
4068
4069/// `<<`.
4070#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
4071#[try_clone(copy)]
4072#[non_exhaustive]
4073pub struct LtLt {
4074    /// Associated span.
4075    pub span: ast::Span,
4076}
4077
4078impl ast::Spanned for LtLt {
4079    #[inline]
4080    fn span(&self) -> ast::Span {
4081        self.span
4082    }
4083}
4084
4085impl ast::OptionSpanned for LtLt {
4086    #[inline]
4087    fn option_span(&self) -> Option<ast::Span> {
4088        Some(self.span)
4089    }
4090}
4091
4092impl ast::ToAst for LtLt {
4093    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
4094        match kind {
4095            ast::Kind::LtLt => Ok(Self { span }),
4096            _ => Err(compile::Error::expected(
4097                ast::Token { span, kind },
4098                ast::Kind::LtLt,
4099            )),
4100        }
4101    }
4102
4103    fn matches(kind: &ast::Kind) -> bool {
4104        match kind {
4105            ast::Kind::LtLt => true,
4106            _ => false,
4107        }
4108    }
4109
4110    #[inline]
4111    fn into_expectation() -> parse::Expectation {
4112        parse::Expectation::Punctuation("<<")
4113    }
4114}
4115
4116impl parse::Parse for LtLt {
4117    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
4118        let token = p.next()?;
4119
4120        match token.kind {
4121            ast::Kind::LtLt => Ok(Self { span: token.span }),
4122            _ => Err(compile::Error::expected(token, ast::Kind::LtLt)),
4123        }
4124    }
4125}
4126
4127impl parse::Peek for LtLt {
4128    #[inline]
4129    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
4130        matches!(peeker.nth(0), ast::Kind::LtLt)
4131    }
4132}
4133
4134impl macros::ToTokens for LtLt {
4135    fn to_tokens(
4136        &self,
4137        _: &mut macros::MacroContext<'_, '_, '_>,
4138        stream: &mut macros::TokenStream,
4139    ) -> crate::alloc::Result<()> {
4140        stream.push(ast::Token {
4141            span: self.span,
4142            kind: ast::Kind::LtLt,
4143        })
4144    }
4145}
4146
4147/// `<<=`.
4148#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
4149#[try_clone(copy)]
4150#[non_exhaustive]
4151pub struct LtLtEq {
4152    /// Associated span.
4153    pub span: ast::Span,
4154}
4155
4156impl ast::Spanned for LtLtEq {
4157    #[inline]
4158    fn span(&self) -> ast::Span {
4159        self.span
4160    }
4161}
4162
4163impl ast::OptionSpanned for LtLtEq {
4164    #[inline]
4165    fn option_span(&self) -> Option<ast::Span> {
4166        Some(self.span)
4167    }
4168}
4169
4170impl ast::ToAst for LtLtEq {
4171    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
4172        match kind {
4173            ast::Kind::LtLtEq => Ok(Self { span }),
4174            _ => Err(compile::Error::expected(
4175                ast::Token { span, kind },
4176                ast::Kind::LtLtEq,
4177            )),
4178        }
4179    }
4180
4181    fn matches(kind: &ast::Kind) -> bool {
4182        match kind {
4183            ast::Kind::LtLtEq => true,
4184            _ => false,
4185        }
4186    }
4187
4188    #[inline]
4189    fn into_expectation() -> parse::Expectation {
4190        parse::Expectation::Punctuation("<<=")
4191    }
4192}
4193
4194impl parse::Parse for LtLtEq {
4195    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
4196        let token = p.next()?;
4197
4198        match token.kind {
4199            ast::Kind::LtLtEq => Ok(Self { span: token.span }),
4200            _ => Err(compile::Error::expected(token, ast::Kind::LtLtEq)),
4201        }
4202    }
4203}
4204
4205impl parse::Peek for LtLtEq {
4206    #[inline]
4207    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
4208        matches!(peeker.nth(0), ast::Kind::LtLtEq)
4209    }
4210}
4211
4212impl macros::ToTokens for LtLtEq {
4213    fn to_tokens(
4214        &self,
4215        _: &mut macros::MacroContext<'_, '_, '_>,
4216        stream: &mut macros::TokenStream,
4217    ) -> crate::alloc::Result<()> {
4218        stream.push(ast::Token {
4219            span: self.span,
4220            kind: ast::Kind::LtLtEq,
4221        })
4222    }
4223}
4224
4225/// The `macro` keyword.
4226#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
4227#[try_clone(copy)]
4228#[non_exhaustive]
4229pub struct Macro {
4230    /// Associated span.
4231    pub span: ast::Span,
4232}
4233
4234impl ast::Spanned for Macro {
4235    #[inline]
4236    fn span(&self) -> ast::Span {
4237        self.span
4238    }
4239}
4240
4241impl ast::OptionSpanned for Macro {
4242    #[inline]
4243    fn option_span(&self) -> Option<ast::Span> {
4244        Some(self.span)
4245    }
4246}
4247
4248impl ast::ToAst for Macro {
4249    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
4250        match kind {
4251            ast::Kind::Macro => Ok(Self { span }),
4252            _ => Err(compile::Error::expected(
4253                ast::Token { span, kind },
4254                ast::Kind::Macro,
4255            )),
4256        }
4257    }
4258
4259    fn matches(kind: &ast::Kind) -> bool {
4260        match kind {
4261            ast::Kind::Macro => true,
4262            _ => false,
4263        }
4264    }
4265
4266    #[inline]
4267    fn into_expectation() -> parse::Expectation {
4268        parse::Expectation::Keyword("macro")
4269    }
4270}
4271
4272impl parse::Parse for Macro {
4273    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
4274        let token = p.next()?;
4275
4276        match token.kind {
4277            ast::Kind::Macro => Ok(Self { span: token.span }),
4278            _ => Err(compile::Error::expected(token, ast::Kind::Macro)),
4279        }
4280    }
4281}
4282
4283impl parse::Peek for Macro {
4284    #[inline]
4285    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
4286        matches!(peeker.nth(0), ast::Kind::Macro)
4287    }
4288}
4289
4290impl macros::ToTokens for Macro {
4291    fn to_tokens(
4292        &self,
4293        _: &mut macros::MacroContext<'_, '_, '_>,
4294        stream: &mut macros::TokenStream,
4295    ) -> crate::alloc::Result<()> {
4296        stream.push(ast::Token {
4297            span: self.span,
4298            kind: ast::Kind::Macro,
4299        })
4300    }
4301}
4302
4303/// The `match` keyword.
4304#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
4305#[try_clone(copy)]
4306#[non_exhaustive]
4307pub struct Match {
4308    /// Associated span.
4309    pub span: ast::Span,
4310}
4311
4312impl ast::Spanned for Match {
4313    #[inline]
4314    fn span(&self) -> ast::Span {
4315        self.span
4316    }
4317}
4318
4319impl ast::OptionSpanned for Match {
4320    #[inline]
4321    fn option_span(&self) -> Option<ast::Span> {
4322        Some(self.span)
4323    }
4324}
4325
4326impl ast::ToAst for Match {
4327    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
4328        match kind {
4329            ast::Kind::Match => Ok(Self { span }),
4330            _ => Err(compile::Error::expected(
4331                ast::Token { span, kind },
4332                ast::Kind::Match,
4333            )),
4334        }
4335    }
4336
4337    fn matches(kind: &ast::Kind) -> bool {
4338        match kind {
4339            ast::Kind::Match => true,
4340            _ => false,
4341        }
4342    }
4343
4344    #[inline]
4345    fn into_expectation() -> parse::Expectation {
4346        parse::Expectation::Keyword("match")
4347    }
4348}
4349
4350impl parse::Parse for Match {
4351    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
4352        let token = p.next()?;
4353
4354        match token.kind {
4355            ast::Kind::Match => Ok(Self { span: token.span }),
4356            _ => Err(compile::Error::expected(token, ast::Kind::Match)),
4357        }
4358    }
4359}
4360
4361impl parse::Peek for Match {
4362    #[inline]
4363    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
4364        matches!(peeker.nth(0), ast::Kind::Match)
4365    }
4366}
4367
4368impl macros::ToTokens for Match {
4369    fn to_tokens(
4370        &self,
4371        _: &mut macros::MacroContext<'_, '_, '_>,
4372        stream: &mut macros::TokenStream,
4373    ) -> crate::alloc::Result<()> {
4374        stream.push(ast::Token {
4375            span: self.span,
4376            kind: ast::Kind::Match,
4377        })
4378    }
4379}
4380
4381/// The `mod` keyword.
4382#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
4383#[try_clone(copy)]
4384#[non_exhaustive]
4385pub struct Mod {
4386    /// Associated span.
4387    pub span: ast::Span,
4388}
4389
4390impl ast::Spanned for Mod {
4391    #[inline]
4392    fn span(&self) -> ast::Span {
4393        self.span
4394    }
4395}
4396
4397impl ast::OptionSpanned for Mod {
4398    #[inline]
4399    fn option_span(&self) -> Option<ast::Span> {
4400        Some(self.span)
4401    }
4402}
4403
4404impl ast::ToAst for Mod {
4405    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
4406        match kind {
4407            ast::Kind::Mod => Ok(Self { span }),
4408            _ => Err(compile::Error::expected(
4409                ast::Token { span, kind },
4410                ast::Kind::Mod,
4411            )),
4412        }
4413    }
4414
4415    fn matches(kind: &ast::Kind) -> bool {
4416        match kind {
4417            ast::Kind::Mod => true,
4418            _ => false,
4419        }
4420    }
4421
4422    #[inline]
4423    fn into_expectation() -> parse::Expectation {
4424        parse::Expectation::Keyword("mod")
4425    }
4426}
4427
4428impl parse::Parse for Mod {
4429    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
4430        let token = p.next()?;
4431
4432        match token.kind {
4433            ast::Kind::Mod => Ok(Self { span: token.span }),
4434            _ => Err(compile::Error::expected(token, ast::Kind::Mod)),
4435        }
4436    }
4437}
4438
4439impl parse::Peek for Mod {
4440    #[inline]
4441    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
4442        matches!(peeker.nth(0), ast::Kind::Mod)
4443    }
4444}
4445
4446impl macros::ToTokens for Mod {
4447    fn to_tokens(
4448        &self,
4449        _: &mut macros::MacroContext<'_, '_, '_>,
4450        stream: &mut macros::TokenStream,
4451    ) -> crate::alloc::Result<()> {
4452        stream.push(ast::Token {
4453            span: self.span,
4454            kind: ast::Kind::Mod,
4455        })
4456    }
4457}
4458
4459/// The `move` keyword.
4460#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
4461#[try_clone(copy)]
4462#[non_exhaustive]
4463pub struct Move {
4464    /// Associated span.
4465    pub span: ast::Span,
4466}
4467
4468impl ast::Spanned for Move {
4469    #[inline]
4470    fn span(&self) -> ast::Span {
4471        self.span
4472    }
4473}
4474
4475impl ast::OptionSpanned for Move {
4476    #[inline]
4477    fn option_span(&self) -> Option<ast::Span> {
4478        Some(self.span)
4479    }
4480}
4481
4482impl ast::ToAst for Move {
4483    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
4484        match kind {
4485            ast::Kind::Move => Ok(Self { span }),
4486            _ => Err(compile::Error::expected(
4487                ast::Token { span, kind },
4488                ast::Kind::Move,
4489            )),
4490        }
4491    }
4492
4493    fn matches(kind: &ast::Kind) -> bool {
4494        match kind {
4495            ast::Kind::Move => true,
4496            _ => false,
4497        }
4498    }
4499
4500    #[inline]
4501    fn into_expectation() -> parse::Expectation {
4502        parse::Expectation::Keyword("move")
4503    }
4504}
4505
4506impl parse::Parse for Move {
4507    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
4508        let token = p.next()?;
4509
4510        match token.kind {
4511            ast::Kind::Move => Ok(Self { span: token.span }),
4512            _ => Err(compile::Error::expected(token, ast::Kind::Move)),
4513        }
4514    }
4515}
4516
4517impl parse::Peek for Move {
4518    #[inline]
4519    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
4520        matches!(peeker.nth(0), ast::Kind::Move)
4521    }
4522}
4523
4524impl macros::ToTokens for Move {
4525    fn to_tokens(
4526        &self,
4527        _: &mut macros::MacroContext<'_, '_, '_>,
4528        stream: &mut macros::TokenStream,
4529    ) -> crate::alloc::Result<()> {
4530        stream.push(ast::Token {
4531            span: self.span,
4532            kind: ast::Kind::Move,
4533        })
4534    }
4535}
4536
4537/// The `mut` keyword.
4538#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
4539#[try_clone(copy)]
4540#[non_exhaustive]
4541pub struct Mut {
4542    /// Associated span.
4543    pub span: ast::Span,
4544}
4545
4546impl ast::Spanned for Mut {
4547    #[inline]
4548    fn span(&self) -> ast::Span {
4549        self.span
4550    }
4551}
4552
4553impl ast::OptionSpanned for Mut {
4554    #[inline]
4555    fn option_span(&self) -> Option<ast::Span> {
4556        Some(self.span)
4557    }
4558}
4559
4560impl ast::ToAst for Mut {
4561    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
4562        match kind {
4563            ast::Kind::Mut => Ok(Self { span }),
4564            _ => Err(compile::Error::expected(
4565                ast::Token { span, kind },
4566                ast::Kind::Mut,
4567            )),
4568        }
4569    }
4570
4571    fn matches(kind: &ast::Kind) -> bool {
4572        match kind {
4573            ast::Kind::Mut => true,
4574            _ => false,
4575        }
4576    }
4577
4578    #[inline]
4579    fn into_expectation() -> parse::Expectation {
4580        parse::Expectation::Keyword("mut")
4581    }
4582}
4583
4584impl parse::Parse for Mut {
4585    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
4586        let token = p.next()?;
4587
4588        match token.kind {
4589            ast::Kind::Mut => Ok(Self { span: token.span }),
4590            _ => Err(compile::Error::expected(token, ast::Kind::Mut)),
4591        }
4592    }
4593}
4594
4595impl parse::Peek for Mut {
4596    #[inline]
4597    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
4598        matches!(peeker.nth(0), ast::Kind::Mut)
4599    }
4600}
4601
4602impl macros::ToTokens for Mut {
4603    fn to_tokens(
4604        &self,
4605        _: &mut macros::MacroContext<'_, '_, '_>,
4606        stream: &mut macros::TokenStream,
4607    ) -> crate::alloc::Result<()> {
4608        stream.push(ast::Token {
4609            span: self.span,
4610            kind: ast::Kind::Mut,
4611        })
4612    }
4613}
4614
4615/// The `not` keyword.
4616#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
4617#[try_clone(copy)]
4618#[non_exhaustive]
4619pub struct Not {
4620    /// Associated span.
4621    pub span: ast::Span,
4622}
4623
4624impl ast::Spanned for Not {
4625    #[inline]
4626    fn span(&self) -> ast::Span {
4627        self.span
4628    }
4629}
4630
4631impl ast::OptionSpanned for Not {
4632    #[inline]
4633    fn option_span(&self) -> Option<ast::Span> {
4634        Some(self.span)
4635    }
4636}
4637
4638impl ast::ToAst for Not {
4639    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
4640        match kind {
4641            ast::Kind::Not => Ok(Self { span }),
4642            _ => Err(compile::Error::expected(
4643                ast::Token { span, kind },
4644                ast::Kind::Not,
4645            )),
4646        }
4647    }
4648
4649    fn matches(kind: &ast::Kind) -> bool {
4650        match kind {
4651            ast::Kind::Not => true,
4652            _ => false,
4653        }
4654    }
4655
4656    #[inline]
4657    fn into_expectation() -> parse::Expectation {
4658        parse::Expectation::Keyword("not")
4659    }
4660}
4661
4662impl parse::Parse for Not {
4663    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
4664        let token = p.next()?;
4665
4666        match token.kind {
4667            ast::Kind::Not => Ok(Self { span: token.span }),
4668            _ => Err(compile::Error::expected(token, ast::Kind::Not)),
4669        }
4670    }
4671}
4672
4673impl parse::Peek for Not {
4674    #[inline]
4675    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
4676        matches!(peeker.nth(0), ast::Kind::Not)
4677    }
4678}
4679
4680impl macros::ToTokens for Not {
4681    fn to_tokens(
4682        &self,
4683        _: &mut macros::MacroContext<'_, '_, '_>,
4684        stream: &mut macros::TokenStream,
4685    ) -> crate::alloc::Result<()> {
4686        stream.push(ast::Token {
4687            span: self.span,
4688            kind: ast::Kind::Not,
4689        })
4690    }
4691}
4692
4693/// The `offsetof` keyword.
4694#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
4695#[try_clone(copy)]
4696#[non_exhaustive]
4697pub struct OffsetOf {
4698    /// Associated span.
4699    pub span: ast::Span,
4700}
4701
4702impl ast::Spanned for OffsetOf {
4703    #[inline]
4704    fn span(&self) -> ast::Span {
4705        self.span
4706    }
4707}
4708
4709impl ast::OptionSpanned for OffsetOf {
4710    #[inline]
4711    fn option_span(&self) -> Option<ast::Span> {
4712        Some(self.span)
4713    }
4714}
4715
4716impl ast::ToAst for OffsetOf {
4717    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
4718        match kind {
4719            ast::Kind::OffsetOf => Ok(Self { span }),
4720            _ => Err(compile::Error::expected(
4721                ast::Token { span, kind },
4722                ast::Kind::OffsetOf,
4723            )),
4724        }
4725    }
4726
4727    fn matches(kind: &ast::Kind) -> bool {
4728        match kind {
4729            ast::Kind::OffsetOf => true,
4730            _ => false,
4731        }
4732    }
4733
4734    #[inline]
4735    fn into_expectation() -> parse::Expectation {
4736        parse::Expectation::Keyword("offsetof")
4737    }
4738}
4739
4740impl parse::Parse for OffsetOf {
4741    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
4742        let token = p.next()?;
4743
4744        match token.kind {
4745            ast::Kind::OffsetOf => Ok(Self { span: token.span }),
4746            _ => Err(compile::Error::expected(token, ast::Kind::OffsetOf)),
4747        }
4748    }
4749}
4750
4751impl parse::Peek for OffsetOf {
4752    #[inline]
4753    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
4754        matches!(peeker.nth(0), ast::Kind::OffsetOf)
4755    }
4756}
4757
4758impl macros::ToTokens for OffsetOf {
4759    fn to_tokens(
4760        &self,
4761        _: &mut macros::MacroContext<'_, '_, '_>,
4762        stream: &mut macros::TokenStream,
4763    ) -> crate::alloc::Result<()> {
4764        stream.push(ast::Token {
4765            span: self.span,
4766            kind: ast::Kind::OffsetOf,
4767        })
4768    }
4769}
4770
4771/// The `override` keyword.
4772#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
4773#[try_clone(copy)]
4774#[non_exhaustive]
4775pub struct Override {
4776    /// Associated span.
4777    pub span: ast::Span,
4778}
4779
4780impl ast::Spanned for Override {
4781    #[inline]
4782    fn span(&self) -> ast::Span {
4783        self.span
4784    }
4785}
4786
4787impl ast::OptionSpanned for Override {
4788    #[inline]
4789    fn option_span(&self) -> Option<ast::Span> {
4790        Some(self.span)
4791    }
4792}
4793
4794impl ast::ToAst for Override {
4795    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
4796        match kind {
4797            ast::Kind::Override => Ok(Self { span }),
4798            _ => Err(compile::Error::expected(
4799                ast::Token { span, kind },
4800                ast::Kind::Override,
4801            )),
4802        }
4803    }
4804
4805    fn matches(kind: &ast::Kind) -> bool {
4806        match kind {
4807            ast::Kind::Override => true,
4808            _ => false,
4809        }
4810    }
4811
4812    #[inline]
4813    fn into_expectation() -> parse::Expectation {
4814        parse::Expectation::Keyword("override")
4815    }
4816}
4817
4818impl parse::Parse for Override {
4819    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
4820        let token = p.next()?;
4821
4822        match token.kind {
4823            ast::Kind::Override => Ok(Self { span: token.span }),
4824            _ => Err(compile::Error::expected(token, ast::Kind::Override)),
4825        }
4826    }
4827}
4828
4829impl parse::Peek for Override {
4830    #[inline]
4831    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
4832        matches!(peeker.nth(0), ast::Kind::Override)
4833    }
4834}
4835
4836impl macros::ToTokens for Override {
4837    fn to_tokens(
4838        &self,
4839        _: &mut macros::MacroContext<'_, '_, '_>,
4840        stream: &mut macros::TokenStream,
4841    ) -> crate::alloc::Result<()> {
4842        stream.push(ast::Token {
4843            span: self.span,
4844            kind: ast::Kind::Override,
4845        })
4846    }
4847}
4848
4849/// `%`.
4850#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
4851#[try_clone(copy)]
4852#[non_exhaustive]
4853pub struct Perc {
4854    /// Associated span.
4855    pub span: ast::Span,
4856}
4857
4858impl ast::Spanned for Perc {
4859    #[inline]
4860    fn span(&self) -> ast::Span {
4861        self.span
4862    }
4863}
4864
4865impl ast::OptionSpanned for Perc {
4866    #[inline]
4867    fn option_span(&self) -> Option<ast::Span> {
4868        Some(self.span)
4869    }
4870}
4871
4872impl ast::ToAst for Perc {
4873    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
4874        match kind {
4875            ast::Kind::Perc => Ok(Self { span }),
4876            _ => Err(compile::Error::expected(
4877                ast::Token { span, kind },
4878                ast::Kind::Perc,
4879            )),
4880        }
4881    }
4882
4883    fn matches(kind: &ast::Kind) -> bool {
4884        match kind {
4885            ast::Kind::Perc => true,
4886            _ => false,
4887        }
4888    }
4889
4890    #[inline]
4891    fn into_expectation() -> parse::Expectation {
4892        parse::Expectation::Punctuation("%")
4893    }
4894}
4895
4896impl parse::Parse for Perc {
4897    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
4898        let token = p.next()?;
4899
4900        match token.kind {
4901            ast::Kind::Perc => Ok(Self { span: token.span }),
4902            _ => Err(compile::Error::expected(token, ast::Kind::Perc)),
4903        }
4904    }
4905}
4906
4907impl parse::Peek for Perc {
4908    #[inline]
4909    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
4910        matches!(peeker.nth(0), ast::Kind::Perc)
4911    }
4912}
4913
4914impl macros::ToTokens for Perc {
4915    fn to_tokens(
4916        &self,
4917        _: &mut macros::MacroContext<'_, '_, '_>,
4918        stream: &mut macros::TokenStream,
4919    ) -> crate::alloc::Result<()> {
4920        stream.push(ast::Token {
4921            span: self.span,
4922            kind: ast::Kind::Perc,
4923        })
4924    }
4925}
4926
4927/// `%=`.
4928#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
4929#[try_clone(copy)]
4930#[non_exhaustive]
4931pub struct PercEq {
4932    /// Associated span.
4933    pub span: ast::Span,
4934}
4935
4936impl ast::Spanned for PercEq {
4937    #[inline]
4938    fn span(&self) -> ast::Span {
4939        self.span
4940    }
4941}
4942
4943impl ast::OptionSpanned for PercEq {
4944    #[inline]
4945    fn option_span(&self) -> Option<ast::Span> {
4946        Some(self.span)
4947    }
4948}
4949
4950impl ast::ToAst for PercEq {
4951    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
4952        match kind {
4953            ast::Kind::PercEq => Ok(Self { span }),
4954            _ => Err(compile::Error::expected(
4955                ast::Token { span, kind },
4956                ast::Kind::PercEq,
4957            )),
4958        }
4959    }
4960
4961    fn matches(kind: &ast::Kind) -> bool {
4962        match kind {
4963            ast::Kind::PercEq => true,
4964            _ => false,
4965        }
4966    }
4967
4968    #[inline]
4969    fn into_expectation() -> parse::Expectation {
4970        parse::Expectation::Punctuation("%=")
4971    }
4972}
4973
4974impl parse::Parse for PercEq {
4975    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
4976        let token = p.next()?;
4977
4978        match token.kind {
4979            ast::Kind::PercEq => Ok(Self { span: token.span }),
4980            _ => Err(compile::Error::expected(token, ast::Kind::PercEq)),
4981        }
4982    }
4983}
4984
4985impl parse::Peek for PercEq {
4986    #[inline]
4987    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
4988        matches!(peeker.nth(0), ast::Kind::PercEq)
4989    }
4990}
4991
4992impl macros::ToTokens for PercEq {
4993    fn to_tokens(
4994        &self,
4995        _: &mut macros::MacroContext<'_, '_, '_>,
4996        stream: &mut macros::TokenStream,
4997    ) -> crate::alloc::Result<()> {
4998        stream.push(ast::Token {
4999            span: self.span,
5000            kind: ast::Kind::PercEq,
5001        })
5002    }
5003}
5004
5005/// `|`.
5006#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
5007#[try_clone(copy)]
5008#[non_exhaustive]
5009pub struct Pipe {
5010    /// Associated span.
5011    pub span: ast::Span,
5012}
5013
5014impl ast::Spanned for Pipe {
5015    #[inline]
5016    fn span(&self) -> ast::Span {
5017        self.span
5018    }
5019}
5020
5021impl ast::OptionSpanned for Pipe {
5022    #[inline]
5023    fn option_span(&self) -> Option<ast::Span> {
5024        Some(self.span)
5025    }
5026}
5027
5028impl ast::ToAst for Pipe {
5029    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
5030        match kind {
5031            ast::Kind::Pipe => Ok(Self { span }),
5032            _ => Err(compile::Error::expected(
5033                ast::Token { span, kind },
5034                ast::Kind::Pipe,
5035            )),
5036        }
5037    }
5038
5039    fn matches(kind: &ast::Kind) -> bool {
5040        match kind {
5041            ast::Kind::Pipe => true,
5042            _ => false,
5043        }
5044    }
5045
5046    #[inline]
5047    fn into_expectation() -> parse::Expectation {
5048        parse::Expectation::Punctuation("|")
5049    }
5050}
5051
5052impl parse::Parse for Pipe {
5053    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
5054        let token = p.next()?;
5055
5056        match token.kind {
5057            ast::Kind::Pipe => Ok(Self { span: token.span }),
5058            _ => Err(compile::Error::expected(token, ast::Kind::Pipe)),
5059        }
5060    }
5061}
5062
5063impl parse::Peek for Pipe {
5064    #[inline]
5065    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
5066        matches!(peeker.nth(0), ast::Kind::Pipe)
5067    }
5068}
5069
5070impl macros::ToTokens for Pipe {
5071    fn to_tokens(
5072        &self,
5073        _: &mut macros::MacroContext<'_, '_, '_>,
5074        stream: &mut macros::TokenStream,
5075    ) -> crate::alloc::Result<()> {
5076        stream.push(ast::Token {
5077            span: self.span,
5078            kind: ast::Kind::Pipe,
5079        })
5080    }
5081}
5082
5083/// |=`.
5084#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
5085#[try_clone(copy)]
5086#[non_exhaustive]
5087pub struct PipeEq {
5088    /// Associated span.
5089    pub span: ast::Span,
5090}
5091
5092impl ast::Spanned for PipeEq {
5093    #[inline]
5094    fn span(&self) -> ast::Span {
5095        self.span
5096    }
5097}
5098
5099impl ast::OptionSpanned for PipeEq {
5100    #[inline]
5101    fn option_span(&self) -> Option<ast::Span> {
5102        Some(self.span)
5103    }
5104}
5105
5106impl ast::ToAst for PipeEq {
5107    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
5108        match kind {
5109            ast::Kind::PipeEq => Ok(Self { span }),
5110            _ => Err(compile::Error::expected(
5111                ast::Token { span, kind },
5112                ast::Kind::PipeEq,
5113            )),
5114        }
5115    }
5116
5117    fn matches(kind: &ast::Kind) -> bool {
5118        match kind {
5119            ast::Kind::PipeEq => true,
5120            _ => false,
5121        }
5122    }
5123
5124    #[inline]
5125    fn into_expectation() -> parse::Expectation {
5126        parse::Expectation::Punctuation("|=")
5127    }
5128}
5129
5130impl parse::Parse for PipeEq {
5131    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
5132        let token = p.next()?;
5133
5134        match token.kind {
5135            ast::Kind::PipeEq => Ok(Self { span: token.span }),
5136            _ => Err(compile::Error::expected(token, ast::Kind::PipeEq)),
5137        }
5138    }
5139}
5140
5141impl parse::Peek for PipeEq {
5142    #[inline]
5143    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
5144        matches!(peeker.nth(0), ast::Kind::PipeEq)
5145    }
5146}
5147
5148impl macros::ToTokens for PipeEq {
5149    fn to_tokens(
5150        &self,
5151        _: &mut macros::MacroContext<'_, '_, '_>,
5152        stream: &mut macros::TokenStream,
5153    ) -> crate::alloc::Result<()> {
5154        stream.push(ast::Token {
5155            span: self.span,
5156            kind: ast::Kind::PipeEq,
5157        })
5158    }
5159}
5160
5161/// `||`.
5162#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
5163#[try_clone(copy)]
5164#[non_exhaustive]
5165pub struct PipePipe {
5166    /// Associated span.
5167    pub span: ast::Span,
5168}
5169
5170impl ast::Spanned for PipePipe {
5171    #[inline]
5172    fn span(&self) -> ast::Span {
5173        self.span
5174    }
5175}
5176
5177impl ast::OptionSpanned for PipePipe {
5178    #[inline]
5179    fn option_span(&self) -> Option<ast::Span> {
5180        Some(self.span)
5181    }
5182}
5183
5184impl ast::ToAst for PipePipe {
5185    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
5186        match kind {
5187            ast::Kind::PipePipe => Ok(Self { span }),
5188            _ => Err(compile::Error::expected(
5189                ast::Token { span, kind },
5190                ast::Kind::PipePipe,
5191            )),
5192        }
5193    }
5194
5195    fn matches(kind: &ast::Kind) -> bool {
5196        match kind {
5197            ast::Kind::PipePipe => true,
5198            _ => false,
5199        }
5200    }
5201
5202    #[inline]
5203    fn into_expectation() -> parse::Expectation {
5204        parse::Expectation::Punctuation("||")
5205    }
5206}
5207
5208impl parse::Parse for PipePipe {
5209    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
5210        let token = p.next()?;
5211
5212        match token.kind {
5213            ast::Kind::PipePipe => Ok(Self { span: token.span }),
5214            _ => Err(compile::Error::expected(token, ast::Kind::PipePipe)),
5215        }
5216    }
5217}
5218
5219impl parse::Peek for PipePipe {
5220    #[inline]
5221    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
5222        matches!(peeker.nth(0), ast::Kind::PipePipe)
5223    }
5224}
5225
5226impl macros::ToTokens for PipePipe {
5227    fn to_tokens(
5228        &self,
5229        _: &mut macros::MacroContext<'_, '_, '_>,
5230        stream: &mut macros::TokenStream,
5231    ) -> crate::alloc::Result<()> {
5232        stream.push(ast::Token {
5233            span: self.span,
5234            kind: ast::Kind::PipePipe,
5235        })
5236    }
5237}
5238
5239/// `+`.
5240#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
5241#[try_clone(copy)]
5242#[non_exhaustive]
5243pub struct Plus {
5244    /// Associated span.
5245    pub span: ast::Span,
5246}
5247
5248impl ast::Spanned for Plus {
5249    #[inline]
5250    fn span(&self) -> ast::Span {
5251        self.span
5252    }
5253}
5254
5255impl ast::OptionSpanned for Plus {
5256    #[inline]
5257    fn option_span(&self) -> Option<ast::Span> {
5258        Some(self.span)
5259    }
5260}
5261
5262impl ast::ToAst for Plus {
5263    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
5264        match kind {
5265            ast::Kind::Plus => Ok(Self { span }),
5266            _ => Err(compile::Error::expected(
5267                ast::Token { span, kind },
5268                ast::Kind::Plus,
5269            )),
5270        }
5271    }
5272
5273    fn matches(kind: &ast::Kind) -> bool {
5274        match kind {
5275            ast::Kind::Plus => true,
5276            _ => false,
5277        }
5278    }
5279
5280    #[inline]
5281    fn into_expectation() -> parse::Expectation {
5282        parse::Expectation::Punctuation("+")
5283    }
5284}
5285
5286impl parse::Parse for Plus {
5287    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
5288        let token = p.next()?;
5289
5290        match token.kind {
5291            ast::Kind::Plus => Ok(Self { span: token.span }),
5292            _ => Err(compile::Error::expected(token, ast::Kind::Plus)),
5293        }
5294    }
5295}
5296
5297impl parse::Peek for Plus {
5298    #[inline]
5299    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
5300        matches!(peeker.nth(0), ast::Kind::Plus)
5301    }
5302}
5303
5304impl macros::ToTokens for Plus {
5305    fn to_tokens(
5306        &self,
5307        _: &mut macros::MacroContext<'_, '_, '_>,
5308        stream: &mut macros::TokenStream,
5309    ) -> crate::alloc::Result<()> {
5310        stream.push(ast::Token {
5311            span: self.span,
5312            kind: ast::Kind::Plus,
5313        })
5314    }
5315}
5316
5317/// `+=`.
5318#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
5319#[try_clone(copy)]
5320#[non_exhaustive]
5321pub struct PlusEq {
5322    /// Associated span.
5323    pub span: ast::Span,
5324}
5325
5326impl ast::Spanned for PlusEq {
5327    #[inline]
5328    fn span(&self) -> ast::Span {
5329        self.span
5330    }
5331}
5332
5333impl ast::OptionSpanned for PlusEq {
5334    #[inline]
5335    fn option_span(&self) -> Option<ast::Span> {
5336        Some(self.span)
5337    }
5338}
5339
5340impl ast::ToAst for PlusEq {
5341    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
5342        match kind {
5343            ast::Kind::PlusEq => Ok(Self { span }),
5344            _ => Err(compile::Error::expected(
5345                ast::Token { span, kind },
5346                ast::Kind::PlusEq,
5347            )),
5348        }
5349    }
5350
5351    fn matches(kind: &ast::Kind) -> bool {
5352        match kind {
5353            ast::Kind::PlusEq => true,
5354            _ => false,
5355        }
5356    }
5357
5358    #[inline]
5359    fn into_expectation() -> parse::Expectation {
5360        parse::Expectation::Punctuation("+=")
5361    }
5362}
5363
5364impl parse::Parse for PlusEq {
5365    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
5366        let token = p.next()?;
5367
5368        match token.kind {
5369            ast::Kind::PlusEq => Ok(Self { span: token.span }),
5370            _ => Err(compile::Error::expected(token, ast::Kind::PlusEq)),
5371        }
5372    }
5373}
5374
5375impl parse::Peek for PlusEq {
5376    #[inline]
5377    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
5378        matches!(peeker.nth(0), ast::Kind::PlusEq)
5379    }
5380}
5381
5382impl macros::ToTokens for PlusEq {
5383    fn to_tokens(
5384        &self,
5385        _: &mut macros::MacroContext<'_, '_, '_>,
5386        stream: &mut macros::TokenStream,
5387    ) -> crate::alloc::Result<()> {
5388        stream.push(ast::Token {
5389            span: self.span,
5390            kind: ast::Kind::PlusEq,
5391        })
5392    }
5393}
5394
5395/// `#`.
5396#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
5397#[try_clone(copy)]
5398#[non_exhaustive]
5399pub struct Pound {
5400    /// Associated span.
5401    pub span: ast::Span,
5402}
5403
5404impl ast::Spanned for Pound {
5405    #[inline]
5406    fn span(&self) -> ast::Span {
5407        self.span
5408    }
5409}
5410
5411impl ast::OptionSpanned for Pound {
5412    #[inline]
5413    fn option_span(&self) -> Option<ast::Span> {
5414        Some(self.span)
5415    }
5416}
5417
5418impl ast::ToAst for Pound {
5419    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
5420        match kind {
5421            ast::Kind::Pound => Ok(Self { span }),
5422            _ => Err(compile::Error::expected(
5423                ast::Token { span, kind },
5424                ast::Kind::Pound,
5425            )),
5426        }
5427    }
5428
5429    fn matches(kind: &ast::Kind) -> bool {
5430        match kind {
5431            ast::Kind::Pound => true,
5432            _ => false,
5433        }
5434    }
5435
5436    #[inline]
5437    fn into_expectation() -> parse::Expectation {
5438        parse::Expectation::Punctuation("#")
5439    }
5440}
5441
5442impl parse::Parse for Pound {
5443    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
5444        let token = p.next()?;
5445
5446        match token.kind {
5447            ast::Kind::Pound => Ok(Self { span: token.span }),
5448            _ => Err(compile::Error::expected(token, ast::Kind::Pound)),
5449        }
5450    }
5451}
5452
5453impl parse::Peek for Pound {
5454    #[inline]
5455    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
5456        matches!(peeker.nth(0), ast::Kind::Pound)
5457    }
5458}
5459
5460impl macros::ToTokens for Pound {
5461    fn to_tokens(
5462        &self,
5463        _: &mut macros::MacroContext<'_, '_, '_>,
5464        stream: &mut macros::TokenStream,
5465    ) -> crate::alloc::Result<()> {
5466        stream.push(ast::Token {
5467            span: self.span,
5468            kind: ast::Kind::Pound,
5469        })
5470    }
5471}
5472
5473/// The `priv` keyword.
5474#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
5475#[try_clone(copy)]
5476#[non_exhaustive]
5477pub struct Priv {
5478    /// Associated span.
5479    pub span: ast::Span,
5480}
5481
5482impl ast::Spanned for Priv {
5483    #[inline]
5484    fn span(&self) -> ast::Span {
5485        self.span
5486    }
5487}
5488
5489impl ast::OptionSpanned for Priv {
5490    #[inline]
5491    fn option_span(&self) -> Option<ast::Span> {
5492        Some(self.span)
5493    }
5494}
5495
5496impl ast::ToAst for Priv {
5497    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
5498        match kind {
5499            ast::Kind::Priv => Ok(Self { span }),
5500            _ => Err(compile::Error::expected(
5501                ast::Token { span, kind },
5502                ast::Kind::Priv,
5503            )),
5504        }
5505    }
5506
5507    fn matches(kind: &ast::Kind) -> bool {
5508        match kind {
5509            ast::Kind::Priv => true,
5510            _ => false,
5511        }
5512    }
5513
5514    #[inline]
5515    fn into_expectation() -> parse::Expectation {
5516        parse::Expectation::Keyword("priv")
5517    }
5518}
5519
5520impl parse::Parse for Priv {
5521    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
5522        let token = p.next()?;
5523
5524        match token.kind {
5525            ast::Kind::Priv => Ok(Self { span: token.span }),
5526            _ => Err(compile::Error::expected(token, ast::Kind::Priv)),
5527        }
5528    }
5529}
5530
5531impl parse::Peek for Priv {
5532    #[inline]
5533    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
5534        matches!(peeker.nth(0), ast::Kind::Priv)
5535    }
5536}
5537
5538impl macros::ToTokens for Priv {
5539    fn to_tokens(
5540        &self,
5541        _: &mut macros::MacroContext<'_, '_, '_>,
5542        stream: &mut macros::TokenStream,
5543    ) -> crate::alloc::Result<()> {
5544        stream.push(ast::Token {
5545            span: self.span,
5546            kind: ast::Kind::Priv,
5547        })
5548    }
5549}
5550
5551/// The `proc` keyword.
5552#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
5553#[try_clone(copy)]
5554#[non_exhaustive]
5555pub struct Proc {
5556    /// Associated span.
5557    pub span: ast::Span,
5558}
5559
5560impl ast::Spanned for Proc {
5561    #[inline]
5562    fn span(&self) -> ast::Span {
5563        self.span
5564    }
5565}
5566
5567impl ast::OptionSpanned for Proc {
5568    #[inline]
5569    fn option_span(&self) -> Option<ast::Span> {
5570        Some(self.span)
5571    }
5572}
5573
5574impl ast::ToAst for Proc {
5575    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
5576        match kind {
5577            ast::Kind::Proc => Ok(Self { span }),
5578            _ => Err(compile::Error::expected(
5579                ast::Token { span, kind },
5580                ast::Kind::Proc,
5581            )),
5582        }
5583    }
5584
5585    fn matches(kind: &ast::Kind) -> bool {
5586        match kind {
5587            ast::Kind::Proc => true,
5588            _ => false,
5589        }
5590    }
5591
5592    #[inline]
5593    fn into_expectation() -> parse::Expectation {
5594        parse::Expectation::Keyword("proc")
5595    }
5596}
5597
5598impl parse::Parse for Proc {
5599    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
5600        let token = p.next()?;
5601
5602        match token.kind {
5603            ast::Kind::Proc => Ok(Self { span: token.span }),
5604            _ => Err(compile::Error::expected(token, ast::Kind::Proc)),
5605        }
5606    }
5607}
5608
5609impl parse::Peek for Proc {
5610    #[inline]
5611    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
5612        matches!(peeker.nth(0), ast::Kind::Proc)
5613    }
5614}
5615
5616impl macros::ToTokens for Proc {
5617    fn to_tokens(
5618        &self,
5619        _: &mut macros::MacroContext<'_, '_, '_>,
5620        stream: &mut macros::TokenStream,
5621    ) -> crate::alloc::Result<()> {
5622        stream.push(ast::Token {
5623            span: self.span,
5624            kind: ast::Kind::Proc,
5625        })
5626    }
5627}
5628
5629/// The `pub` keyword.
5630#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
5631#[try_clone(copy)]
5632#[non_exhaustive]
5633pub struct Pub {
5634    /// Associated span.
5635    pub span: ast::Span,
5636}
5637
5638impl ast::Spanned for Pub {
5639    #[inline]
5640    fn span(&self) -> ast::Span {
5641        self.span
5642    }
5643}
5644
5645impl ast::OptionSpanned for Pub {
5646    #[inline]
5647    fn option_span(&self) -> Option<ast::Span> {
5648        Some(self.span)
5649    }
5650}
5651
5652impl ast::ToAst for Pub {
5653    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
5654        match kind {
5655            ast::Kind::Pub => Ok(Self { span }),
5656            _ => Err(compile::Error::expected(
5657                ast::Token { span, kind },
5658                ast::Kind::Pub,
5659            )),
5660        }
5661    }
5662
5663    fn matches(kind: &ast::Kind) -> bool {
5664        match kind {
5665            ast::Kind::Pub => true,
5666            _ => false,
5667        }
5668    }
5669
5670    #[inline]
5671    fn into_expectation() -> parse::Expectation {
5672        parse::Expectation::Keyword("pub")
5673    }
5674}
5675
5676impl parse::Parse for Pub {
5677    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
5678        let token = p.next()?;
5679
5680        match token.kind {
5681            ast::Kind::Pub => Ok(Self { span: token.span }),
5682            _ => Err(compile::Error::expected(token, ast::Kind::Pub)),
5683        }
5684    }
5685}
5686
5687impl parse::Peek for Pub {
5688    #[inline]
5689    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
5690        matches!(peeker.nth(0), ast::Kind::Pub)
5691    }
5692}
5693
5694impl macros::ToTokens for Pub {
5695    fn to_tokens(
5696        &self,
5697        _: &mut macros::MacroContext<'_, '_, '_>,
5698        stream: &mut macros::TokenStream,
5699    ) -> crate::alloc::Result<()> {
5700        stream.push(ast::Token {
5701            span: self.span,
5702            kind: ast::Kind::Pub,
5703        })
5704    }
5705}
5706
5707/// The `pure` keyword.
5708#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
5709#[try_clone(copy)]
5710#[non_exhaustive]
5711pub struct Pure {
5712    /// Associated span.
5713    pub span: ast::Span,
5714}
5715
5716impl ast::Spanned for Pure {
5717    #[inline]
5718    fn span(&self) -> ast::Span {
5719        self.span
5720    }
5721}
5722
5723impl ast::OptionSpanned for Pure {
5724    #[inline]
5725    fn option_span(&self) -> Option<ast::Span> {
5726        Some(self.span)
5727    }
5728}
5729
5730impl ast::ToAst for Pure {
5731    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
5732        match kind {
5733            ast::Kind::Pure => Ok(Self { span }),
5734            _ => Err(compile::Error::expected(
5735                ast::Token { span, kind },
5736                ast::Kind::Pure,
5737            )),
5738        }
5739    }
5740
5741    fn matches(kind: &ast::Kind) -> bool {
5742        match kind {
5743            ast::Kind::Pure => true,
5744            _ => false,
5745        }
5746    }
5747
5748    #[inline]
5749    fn into_expectation() -> parse::Expectation {
5750        parse::Expectation::Keyword("pure")
5751    }
5752}
5753
5754impl parse::Parse for Pure {
5755    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
5756        let token = p.next()?;
5757
5758        match token.kind {
5759            ast::Kind::Pure => Ok(Self { span: token.span }),
5760            _ => Err(compile::Error::expected(token, ast::Kind::Pure)),
5761        }
5762    }
5763}
5764
5765impl parse::Peek for Pure {
5766    #[inline]
5767    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
5768        matches!(peeker.nth(0), ast::Kind::Pure)
5769    }
5770}
5771
5772impl macros::ToTokens for Pure {
5773    fn to_tokens(
5774        &self,
5775        _: &mut macros::MacroContext<'_, '_, '_>,
5776        stream: &mut macros::TokenStream,
5777    ) -> crate::alloc::Result<()> {
5778        stream.push(ast::Token {
5779            span: self.span,
5780            kind: ast::Kind::Pure,
5781        })
5782    }
5783}
5784
5785/// `?`.
5786#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
5787#[try_clone(copy)]
5788#[non_exhaustive]
5789pub struct QuestionMark {
5790    /// Associated span.
5791    pub span: ast::Span,
5792}
5793
5794impl ast::Spanned for QuestionMark {
5795    #[inline]
5796    fn span(&self) -> ast::Span {
5797        self.span
5798    }
5799}
5800
5801impl ast::OptionSpanned for QuestionMark {
5802    #[inline]
5803    fn option_span(&self) -> Option<ast::Span> {
5804        Some(self.span)
5805    }
5806}
5807
5808impl ast::ToAst for QuestionMark {
5809    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
5810        match kind {
5811            ast::Kind::QuestionMark => Ok(Self { span }),
5812            _ => Err(compile::Error::expected(
5813                ast::Token { span, kind },
5814                ast::Kind::QuestionMark,
5815            )),
5816        }
5817    }
5818
5819    fn matches(kind: &ast::Kind) -> bool {
5820        match kind {
5821            ast::Kind::QuestionMark => true,
5822            _ => false,
5823        }
5824    }
5825
5826    #[inline]
5827    fn into_expectation() -> parse::Expectation {
5828        parse::Expectation::Punctuation("?")
5829    }
5830}
5831
5832impl parse::Parse for QuestionMark {
5833    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
5834        let token = p.next()?;
5835
5836        match token.kind {
5837            ast::Kind::QuestionMark => Ok(Self { span: token.span }),
5838            _ => Err(compile::Error::expected(token, ast::Kind::QuestionMark)),
5839        }
5840    }
5841}
5842
5843impl parse::Peek for QuestionMark {
5844    #[inline]
5845    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
5846        matches!(peeker.nth(0), ast::Kind::QuestionMark)
5847    }
5848}
5849
5850impl macros::ToTokens for QuestionMark {
5851    fn to_tokens(
5852        &self,
5853        _: &mut macros::MacroContext<'_, '_, '_>,
5854        stream: &mut macros::TokenStream,
5855    ) -> crate::alloc::Result<()> {
5856        stream.push(ast::Token {
5857            span: self.span,
5858            kind: ast::Kind::QuestionMark,
5859        })
5860    }
5861}
5862
5863/// The `ref` keyword.
5864#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
5865#[try_clone(copy)]
5866#[non_exhaustive]
5867pub struct Ref {
5868    /// Associated span.
5869    pub span: ast::Span,
5870}
5871
5872impl ast::Spanned for Ref {
5873    #[inline]
5874    fn span(&self) -> ast::Span {
5875        self.span
5876    }
5877}
5878
5879impl ast::OptionSpanned for Ref {
5880    #[inline]
5881    fn option_span(&self) -> Option<ast::Span> {
5882        Some(self.span)
5883    }
5884}
5885
5886impl ast::ToAst for Ref {
5887    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
5888        match kind {
5889            ast::Kind::Ref => Ok(Self { span }),
5890            _ => Err(compile::Error::expected(
5891                ast::Token { span, kind },
5892                ast::Kind::Ref,
5893            )),
5894        }
5895    }
5896
5897    fn matches(kind: &ast::Kind) -> bool {
5898        match kind {
5899            ast::Kind::Ref => true,
5900            _ => false,
5901        }
5902    }
5903
5904    #[inline]
5905    fn into_expectation() -> parse::Expectation {
5906        parse::Expectation::Keyword("ref")
5907    }
5908}
5909
5910impl parse::Parse for Ref {
5911    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
5912        let token = p.next()?;
5913
5914        match token.kind {
5915            ast::Kind::Ref => Ok(Self { span: token.span }),
5916            _ => Err(compile::Error::expected(token, ast::Kind::Ref)),
5917        }
5918    }
5919}
5920
5921impl parse::Peek for Ref {
5922    #[inline]
5923    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
5924        matches!(peeker.nth(0), ast::Kind::Ref)
5925    }
5926}
5927
5928impl macros::ToTokens for Ref {
5929    fn to_tokens(
5930        &self,
5931        _: &mut macros::MacroContext<'_, '_, '_>,
5932        stream: &mut macros::TokenStream,
5933    ) -> crate::alloc::Result<()> {
5934        stream.push(ast::Token {
5935            span: self.span,
5936            kind: ast::Kind::Ref,
5937        })
5938    }
5939}
5940
5941/// The `return` keyword.
5942#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
5943#[try_clone(copy)]
5944#[non_exhaustive]
5945pub struct Return {
5946    /// Associated span.
5947    pub span: ast::Span,
5948}
5949
5950impl ast::Spanned for Return {
5951    #[inline]
5952    fn span(&self) -> ast::Span {
5953        self.span
5954    }
5955}
5956
5957impl ast::OptionSpanned for Return {
5958    #[inline]
5959    fn option_span(&self) -> Option<ast::Span> {
5960        Some(self.span)
5961    }
5962}
5963
5964impl ast::ToAst for Return {
5965    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
5966        match kind {
5967            ast::Kind::Return => Ok(Self { span }),
5968            _ => Err(compile::Error::expected(
5969                ast::Token { span, kind },
5970                ast::Kind::Return,
5971            )),
5972        }
5973    }
5974
5975    fn matches(kind: &ast::Kind) -> bool {
5976        match kind {
5977            ast::Kind::Return => true,
5978            _ => false,
5979        }
5980    }
5981
5982    #[inline]
5983    fn into_expectation() -> parse::Expectation {
5984        parse::Expectation::Keyword("return")
5985    }
5986}
5987
5988impl parse::Parse for Return {
5989    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
5990        let token = p.next()?;
5991
5992        match token.kind {
5993            ast::Kind::Return => Ok(Self { span: token.span }),
5994            _ => Err(compile::Error::expected(token, ast::Kind::Return)),
5995        }
5996    }
5997}
5998
5999impl parse::Peek for Return {
6000    #[inline]
6001    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
6002        matches!(peeker.nth(0), ast::Kind::Return)
6003    }
6004}
6005
6006impl macros::ToTokens for Return {
6007    fn to_tokens(
6008        &self,
6009        _: &mut macros::MacroContext<'_, '_, '_>,
6010        stream: &mut macros::TokenStream,
6011    ) -> crate::alloc::Result<()> {
6012        stream.push(ast::Token {
6013            span: self.span,
6014            kind: ast::Kind::Return,
6015        })
6016    }
6017}
6018
6019/// `=>`.
6020#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
6021#[try_clone(copy)]
6022#[non_exhaustive]
6023pub struct Rocket {
6024    /// Associated span.
6025    pub span: ast::Span,
6026}
6027
6028impl ast::Spanned for Rocket {
6029    #[inline]
6030    fn span(&self) -> ast::Span {
6031        self.span
6032    }
6033}
6034
6035impl ast::OptionSpanned for Rocket {
6036    #[inline]
6037    fn option_span(&self) -> Option<ast::Span> {
6038        Some(self.span)
6039    }
6040}
6041
6042impl ast::ToAst for Rocket {
6043    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
6044        match kind {
6045            ast::Kind::Rocket => Ok(Self { span }),
6046            _ => Err(compile::Error::expected(
6047                ast::Token { span, kind },
6048                ast::Kind::Rocket,
6049            )),
6050        }
6051    }
6052
6053    fn matches(kind: &ast::Kind) -> bool {
6054        match kind {
6055            ast::Kind::Rocket => true,
6056            _ => false,
6057        }
6058    }
6059
6060    #[inline]
6061    fn into_expectation() -> parse::Expectation {
6062        parse::Expectation::Punctuation("=>")
6063    }
6064}
6065
6066impl parse::Parse for Rocket {
6067    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
6068        let token = p.next()?;
6069
6070        match token.kind {
6071            ast::Kind::Rocket => Ok(Self { span: token.span }),
6072            _ => Err(compile::Error::expected(token, ast::Kind::Rocket)),
6073        }
6074    }
6075}
6076
6077impl parse::Peek for Rocket {
6078    #[inline]
6079    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
6080        matches!(peeker.nth(0), ast::Kind::Rocket)
6081    }
6082}
6083
6084impl macros::ToTokens for Rocket {
6085    fn to_tokens(
6086        &self,
6087        _: &mut macros::MacroContext<'_, '_, '_>,
6088        stream: &mut macros::TokenStream,
6089    ) -> crate::alloc::Result<()> {
6090        stream.push(ast::Token {
6091            span: self.span,
6092            kind: ast::Kind::Rocket,
6093        })
6094    }
6095}
6096
6097/// The `select` keyword.
6098#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
6099#[try_clone(copy)]
6100#[non_exhaustive]
6101pub struct Select {
6102    /// Associated span.
6103    pub span: ast::Span,
6104}
6105
6106impl ast::Spanned for Select {
6107    #[inline]
6108    fn span(&self) -> ast::Span {
6109        self.span
6110    }
6111}
6112
6113impl ast::OptionSpanned for Select {
6114    #[inline]
6115    fn option_span(&self) -> Option<ast::Span> {
6116        Some(self.span)
6117    }
6118}
6119
6120impl ast::ToAst for Select {
6121    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
6122        match kind {
6123            ast::Kind::Select => Ok(Self { span }),
6124            _ => Err(compile::Error::expected(
6125                ast::Token { span, kind },
6126                ast::Kind::Select,
6127            )),
6128        }
6129    }
6130
6131    fn matches(kind: &ast::Kind) -> bool {
6132        match kind {
6133            ast::Kind::Select => true,
6134            _ => false,
6135        }
6136    }
6137
6138    #[inline]
6139    fn into_expectation() -> parse::Expectation {
6140        parse::Expectation::Keyword("select")
6141    }
6142}
6143
6144impl parse::Parse for Select {
6145    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
6146        let token = p.next()?;
6147
6148        match token.kind {
6149            ast::Kind::Select => Ok(Self { span: token.span }),
6150            _ => Err(compile::Error::expected(token, ast::Kind::Select)),
6151        }
6152    }
6153}
6154
6155impl parse::Peek for Select {
6156    #[inline]
6157    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
6158        matches!(peeker.nth(0), ast::Kind::Select)
6159    }
6160}
6161
6162impl macros::ToTokens for Select {
6163    fn to_tokens(
6164        &self,
6165        _: &mut macros::MacroContext<'_, '_, '_>,
6166        stream: &mut macros::TokenStream,
6167    ) -> crate::alloc::Result<()> {
6168        stream.push(ast::Token {
6169            span: self.span,
6170            kind: ast::Kind::Select,
6171        })
6172    }
6173}
6174
6175/// The `Self` keyword.
6176#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
6177#[try_clone(copy)]
6178#[non_exhaustive]
6179pub struct SelfType {
6180    /// Associated span.
6181    pub span: ast::Span,
6182}
6183
6184impl ast::Spanned for SelfType {
6185    #[inline]
6186    fn span(&self) -> ast::Span {
6187        self.span
6188    }
6189}
6190
6191impl ast::OptionSpanned for SelfType {
6192    #[inline]
6193    fn option_span(&self) -> Option<ast::Span> {
6194        Some(self.span)
6195    }
6196}
6197
6198impl ast::ToAst for SelfType {
6199    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
6200        match kind {
6201            ast::Kind::SelfType => Ok(Self { span }),
6202            _ => Err(compile::Error::expected(
6203                ast::Token { span, kind },
6204                ast::Kind::SelfType,
6205            )),
6206        }
6207    }
6208
6209    fn matches(kind: &ast::Kind) -> bool {
6210        match kind {
6211            ast::Kind::SelfType => true,
6212            _ => false,
6213        }
6214    }
6215
6216    #[inline]
6217    fn into_expectation() -> parse::Expectation {
6218        parse::Expectation::Keyword("Self")
6219    }
6220}
6221
6222impl parse::Parse for SelfType {
6223    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
6224        let token = p.next()?;
6225
6226        match token.kind {
6227            ast::Kind::SelfType => Ok(Self { span: token.span }),
6228            _ => Err(compile::Error::expected(token, ast::Kind::SelfType)),
6229        }
6230    }
6231}
6232
6233impl parse::Peek for SelfType {
6234    #[inline]
6235    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
6236        matches!(peeker.nth(0), ast::Kind::SelfType)
6237    }
6238}
6239
6240impl macros::ToTokens for SelfType {
6241    fn to_tokens(
6242        &self,
6243        _: &mut macros::MacroContext<'_, '_, '_>,
6244        stream: &mut macros::TokenStream,
6245    ) -> crate::alloc::Result<()> {
6246        stream.push(ast::Token {
6247            span: self.span,
6248            kind: ast::Kind::SelfType,
6249        })
6250    }
6251}
6252
6253/// The `self` keyword.
6254#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
6255#[try_clone(copy)]
6256#[non_exhaustive]
6257pub struct SelfValue {
6258    /// Associated span.
6259    pub span: ast::Span,
6260}
6261
6262impl ast::Spanned for SelfValue {
6263    #[inline]
6264    fn span(&self) -> ast::Span {
6265        self.span
6266    }
6267}
6268
6269impl ast::OptionSpanned for SelfValue {
6270    #[inline]
6271    fn option_span(&self) -> Option<ast::Span> {
6272        Some(self.span)
6273    }
6274}
6275
6276impl ast::ToAst for SelfValue {
6277    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
6278        match kind {
6279            ast::Kind::SelfValue => Ok(Self { span }),
6280            _ => Err(compile::Error::expected(
6281                ast::Token { span, kind },
6282                ast::Kind::SelfValue,
6283            )),
6284        }
6285    }
6286
6287    fn matches(kind: &ast::Kind) -> bool {
6288        match kind {
6289            ast::Kind::SelfValue => true,
6290            _ => false,
6291        }
6292    }
6293
6294    #[inline]
6295    fn into_expectation() -> parse::Expectation {
6296        parse::Expectation::Keyword("self")
6297    }
6298}
6299
6300impl parse::Parse for SelfValue {
6301    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
6302        let token = p.next()?;
6303
6304        match token.kind {
6305            ast::Kind::SelfValue => Ok(Self { span: token.span }),
6306            _ => Err(compile::Error::expected(token, ast::Kind::SelfValue)),
6307        }
6308    }
6309}
6310
6311impl parse::Peek for SelfValue {
6312    #[inline]
6313    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
6314        matches!(peeker.nth(0), ast::Kind::SelfValue)
6315    }
6316}
6317
6318impl macros::ToTokens for SelfValue {
6319    fn to_tokens(
6320        &self,
6321        _: &mut macros::MacroContext<'_, '_, '_>,
6322        stream: &mut macros::TokenStream,
6323    ) -> crate::alloc::Result<()> {
6324        stream.push(ast::Token {
6325            span: self.span,
6326            kind: ast::Kind::SelfValue,
6327        })
6328    }
6329}
6330
6331/// `;`.
6332#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
6333#[try_clone(copy)]
6334#[non_exhaustive]
6335pub struct SemiColon {
6336    /// Associated span.
6337    pub span: ast::Span,
6338}
6339
6340impl ast::Spanned for SemiColon {
6341    #[inline]
6342    fn span(&self) -> ast::Span {
6343        self.span
6344    }
6345}
6346
6347impl ast::OptionSpanned for SemiColon {
6348    #[inline]
6349    fn option_span(&self) -> Option<ast::Span> {
6350        Some(self.span)
6351    }
6352}
6353
6354impl ast::ToAst for SemiColon {
6355    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
6356        match kind {
6357            ast::Kind::SemiColon => Ok(Self { span }),
6358            _ => Err(compile::Error::expected(
6359                ast::Token { span, kind },
6360                ast::Kind::SemiColon,
6361            )),
6362        }
6363    }
6364
6365    fn matches(kind: &ast::Kind) -> bool {
6366        match kind {
6367            ast::Kind::SemiColon => true,
6368            _ => false,
6369        }
6370    }
6371
6372    #[inline]
6373    fn into_expectation() -> parse::Expectation {
6374        parse::Expectation::Punctuation(";")
6375    }
6376}
6377
6378impl parse::Parse for SemiColon {
6379    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
6380        let token = p.next()?;
6381
6382        match token.kind {
6383            ast::Kind::SemiColon => Ok(Self { span: token.span }),
6384            _ => Err(compile::Error::expected(token, ast::Kind::SemiColon)),
6385        }
6386    }
6387}
6388
6389impl parse::Peek for SemiColon {
6390    #[inline]
6391    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
6392        matches!(peeker.nth(0), ast::Kind::SemiColon)
6393    }
6394}
6395
6396impl macros::ToTokens for SemiColon {
6397    fn to_tokens(
6398        &self,
6399        _: &mut macros::MacroContext<'_, '_, '_>,
6400        stream: &mut macros::TokenStream,
6401    ) -> crate::alloc::Result<()> {
6402        stream.push(ast::Token {
6403            span: self.span,
6404            kind: ast::Kind::SemiColon,
6405        })
6406    }
6407}
6408
6409/// The `sizeof` keyword.
6410#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
6411#[try_clone(copy)]
6412#[non_exhaustive]
6413pub struct SizeOf {
6414    /// Associated span.
6415    pub span: ast::Span,
6416}
6417
6418impl ast::Spanned for SizeOf {
6419    #[inline]
6420    fn span(&self) -> ast::Span {
6421        self.span
6422    }
6423}
6424
6425impl ast::OptionSpanned for SizeOf {
6426    #[inline]
6427    fn option_span(&self) -> Option<ast::Span> {
6428        Some(self.span)
6429    }
6430}
6431
6432impl ast::ToAst for SizeOf {
6433    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
6434        match kind {
6435            ast::Kind::SizeOf => Ok(Self { span }),
6436            _ => Err(compile::Error::expected(
6437                ast::Token { span, kind },
6438                ast::Kind::SizeOf,
6439            )),
6440        }
6441    }
6442
6443    fn matches(kind: &ast::Kind) -> bool {
6444        match kind {
6445            ast::Kind::SizeOf => true,
6446            _ => false,
6447        }
6448    }
6449
6450    #[inline]
6451    fn into_expectation() -> parse::Expectation {
6452        parse::Expectation::Keyword("sizeof")
6453    }
6454}
6455
6456impl parse::Parse for SizeOf {
6457    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
6458        let token = p.next()?;
6459
6460        match token.kind {
6461            ast::Kind::SizeOf => Ok(Self { span: token.span }),
6462            _ => Err(compile::Error::expected(token, ast::Kind::SizeOf)),
6463        }
6464    }
6465}
6466
6467impl parse::Peek for SizeOf {
6468    #[inline]
6469    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
6470        matches!(peeker.nth(0), ast::Kind::SizeOf)
6471    }
6472}
6473
6474impl macros::ToTokens for SizeOf {
6475    fn to_tokens(
6476        &self,
6477        _: &mut macros::MacroContext<'_, '_, '_>,
6478        stream: &mut macros::TokenStream,
6479    ) -> crate::alloc::Result<()> {
6480        stream.push(ast::Token {
6481            span: self.span,
6482            kind: ast::Kind::SizeOf,
6483        })
6484    }
6485}
6486
6487/// `/=`.
6488#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
6489#[try_clone(copy)]
6490#[non_exhaustive]
6491pub struct SlashEq {
6492    /// Associated span.
6493    pub span: ast::Span,
6494}
6495
6496impl ast::Spanned for SlashEq {
6497    #[inline]
6498    fn span(&self) -> ast::Span {
6499        self.span
6500    }
6501}
6502
6503impl ast::OptionSpanned for SlashEq {
6504    #[inline]
6505    fn option_span(&self) -> Option<ast::Span> {
6506        Some(self.span)
6507    }
6508}
6509
6510impl ast::ToAst for SlashEq {
6511    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
6512        match kind {
6513            ast::Kind::SlashEq => Ok(Self { span }),
6514            _ => Err(compile::Error::expected(
6515                ast::Token { span, kind },
6516                ast::Kind::SlashEq,
6517            )),
6518        }
6519    }
6520
6521    fn matches(kind: &ast::Kind) -> bool {
6522        match kind {
6523            ast::Kind::SlashEq => true,
6524            _ => false,
6525        }
6526    }
6527
6528    #[inline]
6529    fn into_expectation() -> parse::Expectation {
6530        parse::Expectation::Punctuation("/=")
6531    }
6532}
6533
6534impl parse::Parse for SlashEq {
6535    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
6536        let token = p.next()?;
6537
6538        match token.kind {
6539            ast::Kind::SlashEq => Ok(Self { span: token.span }),
6540            _ => Err(compile::Error::expected(token, ast::Kind::SlashEq)),
6541        }
6542    }
6543}
6544
6545impl parse::Peek for SlashEq {
6546    #[inline]
6547    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
6548        matches!(peeker.nth(0), ast::Kind::SlashEq)
6549    }
6550}
6551
6552impl macros::ToTokens for SlashEq {
6553    fn to_tokens(
6554        &self,
6555        _: &mut macros::MacroContext<'_, '_, '_>,
6556        stream: &mut macros::TokenStream,
6557    ) -> crate::alloc::Result<()> {
6558        stream.push(ast::Token {
6559            span: self.span,
6560            kind: ast::Kind::SlashEq,
6561        })
6562    }
6563}
6564
6565/// `*`.
6566#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
6567#[try_clone(copy)]
6568#[non_exhaustive]
6569pub struct Star {
6570    /// Associated span.
6571    pub span: ast::Span,
6572}
6573
6574impl ast::Spanned for Star {
6575    #[inline]
6576    fn span(&self) -> ast::Span {
6577        self.span
6578    }
6579}
6580
6581impl ast::OptionSpanned for Star {
6582    #[inline]
6583    fn option_span(&self) -> Option<ast::Span> {
6584        Some(self.span)
6585    }
6586}
6587
6588impl ast::ToAst for Star {
6589    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
6590        match kind {
6591            ast::Kind::Star => Ok(Self { span }),
6592            _ => Err(compile::Error::expected(
6593                ast::Token { span, kind },
6594                ast::Kind::Star,
6595            )),
6596        }
6597    }
6598
6599    fn matches(kind: &ast::Kind) -> bool {
6600        match kind {
6601            ast::Kind::Star => true,
6602            _ => false,
6603        }
6604    }
6605
6606    #[inline]
6607    fn into_expectation() -> parse::Expectation {
6608        parse::Expectation::Punctuation("*")
6609    }
6610}
6611
6612impl parse::Parse for Star {
6613    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
6614        let token = p.next()?;
6615
6616        match token.kind {
6617            ast::Kind::Star => Ok(Self { span: token.span }),
6618            _ => Err(compile::Error::expected(token, ast::Kind::Star)),
6619        }
6620    }
6621}
6622
6623impl parse::Peek for Star {
6624    #[inline]
6625    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
6626        matches!(peeker.nth(0), ast::Kind::Star)
6627    }
6628}
6629
6630impl macros::ToTokens for Star {
6631    fn to_tokens(
6632        &self,
6633        _: &mut macros::MacroContext<'_, '_, '_>,
6634        stream: &mut macros::TokenStream,
6635    ) -> crate::alloc::Result<()> {
6636        stream.push(ast::Token {
6637            span: self.span,
6638            kind: ast::Kind::Star,
6639        })
6640    }
6641}
6642
6643/// `*=`.
6644#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
6645#[try_clone(copy)]
6646#[non_exhaustive]
6647pub struct StarEq {
6648    /// Associated span.
6649    pub span: ast::Span,
6650}
6651
6652impl ast::Spanned for StarEq {
6653    #[inline]
6654    fn span(&self) -> ast::Span {
6655        self.span
6656    }
6657}
6658
6659impl ast::OptionSpanned for StarEq {
6660    #[inline]
6661    fn option_span(&self) -> Option<ast::Span> {
6662        Some(self.span)
6663    }
6664}
6665
6666impl ast::ToAst for StarEq {
6667    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
6668        match kind {
6669            ast::Kind::StarEq => Ok(Self { span }),
6670            _ => Err(compile::Error::expected(
6671                ast::Token { span, kind },
6672                ast::Kind::StarEq,
6673            )),
6674        }
6675    }
6676
6677    fn matches(kind: &ast::Kind) -> bool {
6678        match kind {
6679            ast::Kind::StarEq => true,
6680            _ => false,
6681        }
6682    }
6683
6684    #[inline]
6685    fn into_expectation() -> parse::Expectation {
6686        parse::Expectation::Punctuation("*=")
6687    }
6688}
6689
6690impl parse::Parse for StarEq {
6691    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
6692        let token = p.next()?;
6693
6694        match token.kind {
6695            ast::Kind::StarEq => Ok(Self { span: token.span }),
6696            _ => Err(compile::Error::expected(token, ast::Kind::StarEq)),
6697        }
6698    }
6699}
6700
6701impl parse::Peek for StarEq {
6702    #[inline]
6703    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
6704        matches!(peeker.nth(0), ast::Kind::StarEq)
6705    }
6706}
6707
6708impl macros::ToTokens for StarEq {
6709    fn to_tokens(
6710        &self,
6711        _: &mut macros::MacroContext<'_, '_, '_>,
6712        stream: &mut macros::TokenStream,
6713    ) -> crate::alloc::Result<()> {
6714        stream.push(ast::Token {
6715            span: self.span,
6716            kind: ast::Kind::StarEq,
6717        })
6718    }
6719}
6720
6721/// The `static` keyword.
6722#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
6723#[try_clone(copy)]
6724#[non_exhaustive]
6725pub struct Static {
6726    /// Associated span.
6727    pub span: ast::Span,
6728}
6729
6730impl ast::Spanned for Static {
6731    #[inline]
6732    fn span(&self) -> ast::Span {
6733        self.span
6734    }
6735}
6736
6737impl ast::OptionSpanned for Static {
6738    #[inline]
6739    fn option_span(&self) -> Option<ast::Span> {
6740        Some(self.span)
6741    }
6742}
6743
6744impl ast::ToAst for Static {
6745    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
6746        match kind {
6747            ast::Kind::Static => Ok(Self { span }),
6748            _ => Err(compile::Error::expected(
6749                ast::Token { span, kind },
6750                ast::Kind::Static,
6751            )),
6752        }
6753    }
6754
6755    fn matches(kind: &ast::Kind) -> bool {
6756        match kind {
6757            ast::Kind::Static => true,
6758            _ => false,
6759        }
6760    }
6761
6762    #[inline]
6763    fn into_expectation() -> parse::Expectation {
6764        parse::Expectation::Keyword("static")
6765    }
6766}
6767
6768impl parse::Parse for Static {
6769    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
6770        let token = p.next()?;
6771
6772        match token.kind {
6773            ast::Kind::Static => Ok(Self { span: token.span }),
6774            _ => Err(compile::Error::expected(token, ast::Kind::Static)),
6775        }
6776    }
6777}
6778
6779impl parse::Peek for Static {
6780    #[inline]
6781    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
6782        matches!(peeker.nth(0), ast::Kind::Static)
6783    }
6784}
6785
6786impl macros::ToTokens for Static {
6787    fn to_tokens(
6788        &self,
6789        _: &mut macros::MacroContext<'_, '_, '_>,
6790        stream: &mut macros::TokenStream,
6791    ) -> crate::alloc::Result<()> {
6792        stream.push(ast::Token {
6793            span: self.span,
6794            kind: ast::Kind::Static,
6795        })
6796    }
6797}
6798
6799/// The `struct` keyword.
6800#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
6801#[try_clone(copy)]
6802#[non_exhaustive]
6803pub struct Struct {
6804    /// Associated span.
6805    pub span: ast::Span,
6806}
6807
6808impl ast::Spanned for Struct {
6809    #[inline]
6810    fn span(&self) -> ast::Span {
6811        self.span
6812    }
6813}
6814
6815impl ast::OptionSpanned for Struct {
6816    #[inline]
6817    fn option_span(&self) -> Option<ast::Span> {
6818        Some(self.span)
6819    }
6820}
6821
6822impl ast::ToAst for Struct {
6823    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
6824        match kind {
6825            ast::Kind::Struct => Ok(Self { span }),
6826            _ => Err(compile::Error::expected(
6827                ast::Token { span, kind },
6828                ast::Kind::Struct,
6829            )),
6830        }
6831    }
6832
6833    fn matches(kind: &ast::Kind) -> bool {
6834        match kind {
6835            ast::Kind::Struct => true,
6836            _ => false,
6837        }
6838    }
6839
6840    #[inline]
6841    fn into_expectation() -> parse::Expectation {
6842        parse::Expectation::Keyword("struct")
6843    }
6844}
6845
6846impl parse::Parse for Struct {
6847    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
6848        let token = p.next()?;
6849
6850        match token.kind {
6851            ast::Kind::Struct => Ok(Self { span: token.span }),
6852            _ => Err(compile::Error::expected(token, ast::Kind::Struct)),
6853        }
6854    }
6855}
6856
6857impl parse::Peek for Struct {
6858    #[inline]
6859    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
6860        matches!(peeker.nth(0), ast::Kind::Struct)
6861    }
6862}
6863
6864impl macros::ToTokens for Struct {
6865    fn to_tokens(
6866        &self,
6867        _: &mut macros::MacroContext<'_, '_, '_>,
6868        stream: &mut macros::TokenStream,
6869    ) -> crate::alloc::Result<()> {
6870        stream.push(ast::Token {
6871            span: self.span,
6872            kind: ast::Kind::Struct,
6873        })
6874    }
6875}
6876
6877/// The `super` keyword.
6878#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
6879#[try_clone(copy)]
6880#[non_exhaustive]
6881pub struct Super {
6882    /// Associated span.
6883    pub span: ast::Span,
6884}
6885
6886impl ast::Spanned for Super {
6887    #[inline]
6888    fn span(&self) -> ast::Span {
6889        self.span
6890    }
6891}
6892
6893impl ast::OptionSpanned for Super {
6894    #[inline]
6895    fn option_span(&self) -> Option<ast::Span> {
6896        Some(self.span)
6897    }
6898}
6899
6900impl ast::ToAst for Super {
6901    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
6902        match kind {
6903            ast::Kind::Super => Ok(Self { span }),
6904            _ => Err(compile::Error::expected(
6905                ast::Token { span, kind },
6906                ast::Kind::Super,
6907            )),
6908        }
6909    }
6910
6911    fn matches(kind: &ast::Kind) -> bool {
6912        match kind {
6913            ast::Kind::Super => true,
6914            _ => false,
6915        }
6916    }
6917
6918    #[inline]
6919    fn into_expectation() -> parse::Expectation {
6920        parse::Expectation::Keyword("super")
6921    }
6922}
6923
6924impl parse::Parse for Super {
6925    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
6926        let token = p.next()?;
6927
6928        match token.kind {
6929            ast::Kind::Super => Ok(Self { span: token.span }),
6930            _ => Err(compile::Error::expected(token, ast::Kind::Super)),
6931        }
6932    }
6933}
6934
6935impl parse::Peek for Super {
6936    #[inline]
6937    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
6938        matches!(peeker.nth(0), ast::Kind::Super)
6939    }
6940}
6941
6942impl macros::ToTokens for Super {
6943    fn to_tokens(
6944        &self,
6945        _: &mut macros::MacroContext<'_, '_, '_>,
6946        stream: &mut macros::TokenStream,
6947    ) -> crate::alloc::Result<()> {
6948        stream.push(ast::Token {
6949            span: self.span,
6950            kind: ast::Kind::Super,
6951        })
6952    }
6953}
6954
6955/// `~`.
6956#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
6957#[try_clone(copy)]
6958#[non_exhaustive]
6959pub struct Tilde {
6960    /// Associated span.
6961    pub span: ast::Span,
6962}
6963
6964impl ast::Spanned for Tilde {
6965    #[inline]
6966    fn span(&self) -> ast::Span {
6967        self.span
6968    }
6969}
6970
6971impl ast::OptionSpanned for Tilde {
6972    #[inline]
6973    fn option_span(&self) -> Option<ast::Span> {
6974        Some(self.span)
6975    }
6976}
6977
6978impl ast::ToAst for Tilde {
6979    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
6980        match kind {
6981            ast::Kind::Tilde => Ok(Self { span }),
6982            _ => Err(compile::Error::expected(
6983                ast::Token { span, kind },
6984                ast::Kind::Tilde,
6985            )),
6986        }
6987    }
6988
6989    fn matches(kind: &ast::Kind) -> bool {
6990        match kind {
6991            ast::Kind::Tilde => true,
6992            _ => false,
6993        }
6994    }
6995
6996    #[inline]
6997    fn into_expectation() -> parse::Expectation {
6998        parse::Expectation::Punctuation("~")
6999    }
7000}
7001
7002impl parse::Parse for Tilde {
7003    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
7004        let token = p.next()?;
7005
7006        match token.kind {
7007            ast::Kind::Tilde => Ok(Self { span: token.span }),
7008            _ => Err(compile::Error::expected(token, ast::Kind::Tilde)),
7009        }
7010    }
7011}
7012
7013impl parse::Peek for Tilde {
7014    #[inline]
7015    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
7016        matches!(peeker.nth(0), ast::Kind::Tilde)
7017    }
7018}
7019
7020impl macros::ToTokens for Tilde {
7021    fn to_tokens(
7022        &self,
7023        _: &mut macros::MacroContext<'_, '_, '_>,
7024        stream: &mut macros::TokenStream,
7025    ) -> crate::alloc::Result<()> {
7026        stream.push(ast::Token {
7027            span: self.span,
7028            kind: ast::Kind::Tilde,
7029        })
7030    }
7031}
7032
7033/// The `true` keyword.
7034#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
7035#[try_clone(copy)]
7036#[non_exhaustive]
7037pub struct True {
7038    /// Associated span.
7039    pub span: ast::Span,
7040}
7041
7042impl ast::Spanned for True {
7043    #[inline]
7044    fn span(&self) -> ast::Span {
7045        self.span
7046    }
7047}
7048
7049impl ast::OptionSpanned for True {
7050    #[inline]
7051    fn option_span(&self) -> Option<ast::Span> {
7052        Some(self.span)
7053    }
7054}
7055
7056impl ast::ToAst for True {
7057    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
7058        match kind {
7059            ast::Kind::True => Ok(Self { span }),
7060            _ => Err(compile::Error::expected(
7061                ast::Token { span, kind },
7062                ast::Kind::True,
7063            )),
7064        }
7065    }
7066
7067    fn matches(kind: &ast::Kind) -> bool {
7068        match kind {
7069            ast::Kind::True => true,
7070            _ => false,
7071        }
7072    }
7073
7074    #[inline]
7075    fn into_expectation() -> parse::Expectation {
7076        parse::Expectation::Keyword("true")
7077    }
7078}
7079
7080impl parse::Parse for True {
7081    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
7082        let token = p.next()?;
7083
7084        match token.kind {
7085            ast::Kind::True => Ok(Self { span: token.span }),
7086            _ => Err(compile::Error::expected(token, ast::Kind::True)),
7087        }
7088    }
7089}
7090
7091impl parse::Peek for True {
7092    #[inline]
7093    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
7094        matches!(peeker.nth(0), ast::Kind::True)
7095    }
7096}
7097
7098impl macros::ToTokens for True {
7099    fn to_tokens(
7100        &self,
7101        _: &mut macros::MacroContext<'_, '_, '_>,
7102        stream: &mut macros::TokenStream,
7103    ) -> crate::alloc::Result<()> {
7104        stream.push(ast::Token {
7105            span: self.span,
7106            kind: ast::Kind::True,
7107        })
7108    }
7109}
7110
7111/// The `typeof` keyword.
7112#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
7113#[try_clone(copy)]
7114#[non_exhaustive]
7115pub struct TypeOf {
7116    /// Associated span.
7117    pub span: ast::Span,
7118}
7119
7120impl ast::Spanned for TypeOf {
7121    #[inline]
7122    fn span(&self) -> ast::Span {
7123        self.span
7124    }
7125}
7126
7127impl ast::OptionSpanned for TypeOf {
7128    #[inline]
7129    fn option_span(&self) -> Option<ast::Span> {
7130        Some(self.span)
7131    }
7132}
7133
7134impl ast::ToAst for TypeOf {
7135    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
7136        match kind {
7137            ast::Kind::TypeOf => Ok(Self { span }),
7138            _ => Err(compile::Error::expected(
7139                ast::Token { span, kind },
7140                ast::Kind::TypeOf,
7141            )),
7142        }
7143    }
7144
7145    fn matches(kind: &ast::Kind) -> bool {
7146        match kind {
7147            ast::Kind::TypeOf => true,
7148            _ => false,
7149        }
7150    }
7151
7152    #[inline]
7153    fn into_expectation() -> parse::Expectation {
7154        parse::Expectation::Keyword("typeof")
7155    }
7156}
7157
7158impl parse::Parse for TypeOf {
7159    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
7160        let token = p.next()?;
7161
7162        match token.kind {
7163            ast::Kind::TypeOf => Ok(Self { span: token.span }),
7164            _ => Err(compile::Error::expected(token, ast::Kind::TypeOf)),
7165        }
7166    }
7167}
7168
7169impl parse::Peek for TypeOf {
7170    #[inline]
7171    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
7172        matches!(peeker.nth(0), ast::Kind::TypeOf)
7173    }
7174}
7175
7176impl macros::ToTokens for TypeOf {
7177    fn to_tokens(
7178        &self,
7179        _: &mut macros::MacroContext<'_, '_, '_>,
7180        stream: &mut macros::TokenStream,
7181    ) -> crate::alloc::Result<()> {
7182        stream.push(ast::Token {
7183            span: self.span,
7184            kind: ast::Kind::TypeOf,
7185        })
7186    }
7187}
7188
7189/// `_`.
7190#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
7191#[try_clone(copy)]
7192#[non_exhaustive]
7193pub struct Underscore {
7194    /// Associated span.
7195    pub span: ast::Span,
7196}
7197
7198impl ast::Spanned for Underscore {
7199    #[inline]
7200    fn span(&self) -> ast::Span {
7201        self.span
7202    }
7203}
7204
7205impl ast::OptionSpanned for Underscore {
7206    #[inline]
7207    fn option_span(&self) -> Option<ast::Span> {
7208        Some(self.span)
7209    }
7210}
7211
7212impl ast::ToAst for Underscore {
7213    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
7214        match kind {
7215            ast::Kind::Underscore => Ok(Self { span }),
7216            _ => Err(compile::Error::expected(
7217                ast::Token { span, kind },
7218                ast::Kind::Underscore,
7219            )),
7220        }
7221    }
7222
7223    fn matches(kind: &ast::Kind) -> bool {
7224        match kind {
7225            ast::Kind::Underscore => true,
7226            _ => false,
7227        }
7228    }
7229
7230    #[inline]
7231    fn into_expectation() -> parse::Expectation {
7232        parse::Expectation::Punctuation("_")
7233    }
7234}
7235
7236impl parse::Parse for Underscore {
7237    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
7238        let token = p.next()?;
7239
7240        match token.kind {
7241            ast::Kind::Underscore => Ok(Self { span: token.span }),
7242            _ => Err(compile::Error::expected(token, ast::Kind::Underscore)),
7243        }
7244    }
7245}
7246
7247impl parse::Peek for Underscore {
7248    #[inline]
7249    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
7250        matches!(peeker.nth(0), ast::Kind::Underscore)
7251    }
7252}
7253
7254impl macros::ToTokens for Underscore {
7255    fn to_tokens(
7256        &self,
7257        _: &mut macros::MacroContext<'_, '_, '_>,
7258        stream: &mut macros::TokenStream,
7259    ) -> crate::alloc::Result<()> {
7260        stream.push(ast::Token {
7261            span: self.span,
7262            kind: ast::Kind::Underscore,
7263        })
7264    }
7265}
7266
7267/// The `unsafe` keyword.
7268#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
7269#[try_clone(copy)]
7270#[non_exhaustive]
7271pub struct Unsafe {
7272    /// Associated span.
7273    pub span: ast::Span,
7274}
7275
7276impl ast::Spanned for Unsafe {
7277    #[inline]
7278    fn span(&self) -> ast::Span {
7279        self.span
7280    }
7281}
7282
7283impl ast::OptionSpanned for Unsafe {
7284    #[inline]
7285    fn option_span(&self) -> Option<ast::Span> {
7286        Some(self.span)
7287    }
7288}
7289
7290impl ast::ToAst for Unsafe {
7291    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
7292        match kind {
7293            ast::Kind::Unsafe => Ok(Self { span }),
7294            _ => Err(compile::Error::expected(
7295                ast::Token { span, kind },
7296                ast::Kind::Unsafe,
7297            )),
7298        }
7299    }
7300
7301    fn matches(kind: &ast::Kind) -> bool {
7302        match kind {
7303            ast::Kind::Unsafe => true,
7304            _ => false,
7305        }
7306    }
7307
7308    #[inline]
7309    fn into_expectation() -> parse::Expectation {
7310        parse::Expectation::Keyword("unsafe")
7311    }
7312}
7313
7314impl parse::Parse for Unsafe {
7315    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
7316        let token = p.next()?;
7317
7318        match token.kind {
7319            ast::Kind::Unsafe => Ok(Self { span: token.span }),
7320            _ => Err(compile::Error::expected(token, ast::Kind::Unsafe)),
7321        }
7322    }
7323}
7324
7325impl parse::Peek for Unsafe {
7326    #[inline]
7327    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
7328        matches!(peeker.nth(0), ast::Kind::Unsafe)
7329    }
7330}
7331
7332impl macros::ToTokens for Unsafe {
7333    fn to_tokens(
7334        &self,
7335        _: &mut macros::MacroContext<'_, '_, '_>,
7336        stream: &mut macros::TokenStream,
7337    ) -> crate::alloc::Result<()> {
7338        stream.push(ast::Token {
7339            span: self.span,
7340            kind: ast::Kind::Unsafe,
7341        })
7342    }
7343}
7344
7345/// The `use` keyword.
7346#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
7347#[try_clone(copy)]
7348#[non_exhaustive]
7349pub struct Use {
7350    /// Associated span.
7351    pub span: ast::Span,
7352}
7353
7354impl ast::Spanned for Use {
7355    #[inline]
7356    fn span(&self) -> ast::Span {
7357        self.span
7358    }
7359}
7360
7361impl ast::OptionSpanned for Use {
7362    #[inline]
7363    fn option_span(&self) -> Option<ast::Span> {
7364        Some(self.span)
7365    }
7366}
7367
7368impl ast::ToAst for Use {
7369    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
7370        match kind {
7371            ast::Kind::Use => Ok(Self { span }),
7372            _ => Err(compile::Error::expected(
7373                ast::Token { span, kind },
7374                ast::Kind::Use,
7375            )),
7376        }
7377    }
7378
7379    fn matches(kind: &ast::Kind) -> bool {
7380        match kind {
7381            ast::Kind::Use => true,
7382            _ => false,
7383        }
7384    }
7385
7386    #[inline]
7387    fn into_expectation() -> parse::Expectation {
7388        parse::Expectation::Keyword("use")
7389    }
7390}
7391
7392impl parse::Parse for Use {
7393    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
7394        let token = p.next()?;
7395
7396        match token.kind {
7397            ast::Kind::Use => Ok(Self { span: token.span }),
7398            _ => Err(compile::Error::expected(token, ast::Kind::Use)),
7399        }
7400    }
7401}
7402
7403impl parse::Peek for Use {
7404    #[inline]
7405    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
7406        matches!(peeker.nth(0), ast::Kind::Use)
7407    }
7408}
7409
7410impl macros::ToTokens for Use {
7411    fn to_tokens(
7412        &self,
7413        _: &mut macros::MacroContext<'_, '_, '_>,
7414        stream: &mut macros::TokenStream,
7415    ) -> crate::alloc::Result<()> {
7416        stream.push(ast::Token {
7417            span: self.span,
7418            kind: ast::Kind::Use,
7419        })
7420    }
7421}
7422
7423/// The `virtual` keyword.
7424#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
7425#[try_clone(copy)]
7426#[non_exhaustive]
7427pub struct Virtual {
7428    /// Associated span.
7429    pub span: ast::Span,
7430}
7431
7432impl ast::Spanned for Virtual {
7433    #[inline]
7434    fn span(&self) -> ast::Span {
7435        self.span
7436    }
7437}
7438
7439impl ast::OptionSpanned for Virtual {
7440    #[inline]
7441    fn option_span(&self) -> Option<ast::Span> {
7442        Some(self.span)
7443    }
7444}
7445
7446impl ast::ToAst for Virtual {
7447    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
7448        match kind {
7449            ast::Kind::Virtual => Ok(Self { span }),
7450            _ => Err(compile::Error::expected(
7451                ast::Token { span, kind },
7452                ast::Kind::Virtual,
7453            )),
7454        }
7455    }
7456
7457    fn matches(kind: &ast::Kind) -> bool {
7458        match kind {
7459            ast::Kind::Virtual => true,
7460            _ => false,
7461        }
7462    }
7463
7464    #[inline]
7465    fn into_expectation() -> parse::Expectation {
7466        parse::Expectation::Keyword("virtual")
7467    }
7468}
7469
7470impl parse::Parse for Virtual {
7471    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
7472        let token = p.next()?;
7473
7474        match token.kind {
7475            ast::Kind::Virtual => Ok(Self { span: token.span }),
7476            _ => Err(compile::Error::expected(token, ast::Kind::Virtual)),
7477        }
7478    }
7479}
7480
7481impl parse::Peek for Virtual {
7482    #[inline]
7483    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
7484        matches!(peeker.nth(0), ast::Kind::Virtual)
7485    }
7486}
7487
7488impl macros::ToTokens for Virtual {
7489    fn to_tokens(
7490        &self,
7491        _: &mut macros::MacroContext<'_, '_, '_>,
7492        stream: &mut macros::TokenStream,
7493    ) -> crate::alloc::Result<()> {
7494        stream.push(ast::Token {
7495            span: self.span,
7496            kind: ast::Kind::Virtual,
7497        })
7498    }
7499}
7500
7501/// The `while` keyword.
7502#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
7503#[try_clone(copy)]
7504#[non_exhaustive]
7505pub struct While {
7506    /// Associated span.
7507    pub span: ast::Span,
7508}
7509
7510impl ast::Spanned for While {
7511    #[inline]
7512    fn span(&self) -> ast::Span {
7513        self.span
7514    }
7515}
7516
7517impl ast::OptionSpanned for While {
7518    #[inline]
7519    fn option_span(&self) -> Option<ast::Span> {
7520        Some(self.span)
7521    }
7522}
7523
7524impl ast::ToAst for While {
7525    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
7526        match kind {
7527            ast::Kind::While => Ok(Self { span }),
7528            _ => Err(compile::Error::expected(
7529                ast::Token { span, kind },
7530                ast::Kind::While,
7531            )),
7532        }
7533    }
7534
7535    fn matches(kind: &ast::Kind) -> bool {
7536        match kind {
7537            ast::Kind::While => true,
7538            _ => false,
7539        }
7540    }
7541
7542    #[inline]
7543    fn into_expectation() -> parse::Expectation {
7544        parse::Expectation::Keyword("while")
7545    }
7546}
7547
7548impl parse::Parse for While {
7549    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
7550        let token = p.next()?;
7551
7552        match token.kind {
7553            ast::Kind::While => Ok(Self { span: token.span }),
7554            _ => Err(compile::Error::expected(token, ast::Kind::While)),
7555        }
7556    }
7557}
7558
7559impl parse::Peek for While {
7560    #[inline]
7561    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
7562        matches!(peeker.nth(0), ast::Kind::While)
7563    }
7564}
7565
7566impl macros::ToTokens for While {
7567    fn to_tokens(
7568        &self,
7569        _: &mut macros::MacroContext<'_, '_, '_>,
7570        stream: &mut macros::TokenStream,
7571    ) -> crate::alloc::Result<()> {
7572        stream.push(ast::Token {
7573            span: self.span,
7574            kind: ast::Kind::While,
7575        })
7576    }
7577}
7578
7579/// The `yield` keyword.
7580#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, Hash)]
7581#[try_clone(copy)]
7582#[non_exhaustive]
7583pub struct Yield {
7584    /// Associated span.
7585    pub span: ast::Span,
7586}
7587
7588impl ast::Spanned for Yield {
7589    #[inline]
7590    fn span(&self) -> ast::Span {
7591        self.span
7592    }
7593}
7594
7595impl ast::OptionSpanned for Yield {
7596    #[inline]
7597    fn option_span(&self) -> Option<ast::Span> {
7598        Some(self.span)
7599    }
7600}
7601
7602impl ast::ToAst for Yield {
7603    fn to_ast(span: ast::Span, kind: ast::Kind) -> compile::Result<Self> {
7604        match kind {
7605            ast::Kind::Yield => Ok(Self { span }),
7606            _ => Err(compile::Error::expected(
7607                ast::Token { span, kind },
7608                ast::Kind::Yield,
7609            )),
7610        }
7611    }
7612
7613    fn matches(kind: &ast::Kind) -> bool {
7614        match kind {
7615            ast::Kind::Yield => true,
7616            _ => false,
7617        }
7618    }
7619
7620    #[inline]
7621    fn into_expectation() -> parse::Expectation {
7622        parse::Expectation::Keyword("yield")
7623    }
7624}
7625
7626impl parse::Parse for Yield {
7627    fn parse(p: &mut parse::Parser<'_>) -> compile::Result<Self> {
7628        let token = p.next()?;
7629
7630        match token.kind {
7631            ast::Kind::Yield => Ok(Self { span: token.span }),
7632            _ => Err(compile::Error::expected(token, ast::Kind::Yield)),
7633        }
7634    }
7635}
7636
7637impl parse::Peek for Yield {
7638    #[inline]
7639    fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
7640        matches!(peeker.nth(0), ast::Kind::Yield)
7641    }
7642}
7643
7644impl macros::ToTokens for Yield {
7645    fn to_tokens(
7646        &self,
7647        _: &mut macros::MacroContext<'_, '_, '_>,
7648        stream: &mut macros::TokenStream,
7649    ) -> crate::alloc::Result<()> {
7650        stream.push(ast::Token {
7651            span: self.span,
7652            kind: ast::Kind::Yield,
7653        })
7654    }
7655}
7656
7657/// Helper macro to reference a specific token.
7658#[macro_export]
7659macro_rules! T {
7660    ('(') => {
7661        $crate::ast::OpenParen
7662    };
7663    (')') => {
7664        $crate::ast::CloseParen
7665    };
7666    ('[') => {
7667        $crate::ast::OpenBracket
7668    };
7669    (']') => {
7670        $crate::ast::CloseBracket
7671    };
7672    ('{') => {
7673        $crate::ast::OpenBrace
7674    };
7675    ('}') => {
7676        $crate::ast::CloseBrace
7677    };
7678    (is not) => {
7679        $crate::ast::IsNot
7680    };
7681    (abstract) => {
7682        $crate::ast::Abstract
7683    };
7684    (alignof) => {
7685        $crate::ast::AlignOf
7686    };
7687    (as) => {
7688        $crate::ast::As
7689    };
7690    (async) => {
7691        $crate::ast::Async
7692    };
7693    (await) => {
7694        $crate::ast::Await
7695    };
7696    (become) => {
7697        $crate::ast::Become
7698    };
7699    (break) => {
7700        $crate::ast::Break
7701    };
7702    (const) => {
7703        $crate::ast::Const
7704    };
7705    (continue) => {
7706        $crate::ast::Continue
7707    };
7708    (crate) => {
7709        $crate::ast::Crate
7710    };
7711    (default) => {
7712        $crate::ast::Default
7713    };
7714    (do) => {
7715        $crate::ast::Do
7716    };
7717    (else) => {
7718        $crate::ast::Else
7719    };
7720    (enum) => {
7721        $crate::ast::Enum
7722    };
7723    (extern) => {
7724        $crate::ast::Extern
7725    };
7726    (false) => {
7727        $crate::ast::False
7728    };
7729    (final) => {
7730        $crate::ast::Final
7731    };
7732    (fn) => {
7733        $crate::ast::Fn
7734    };
7735    (for) => {
7736        $crate::ast::For
7737    };
7738    (if) => {
7739        $crate::ast::If
7740    };
7741    (impl) => {
7742        $crate::ast::Impl
7743    };
7744    (in) => {
7745        $crate::ast::In
7746    };
7747    (is) => {
7748        $crate::ast::Is
7749    };
7750    (let) => {
7751        $crate::ast::Let
7752    };
7753    (loop) => {
7754        $crate::ast::Loop
7755    };
7756    (macro) => {
7757        $crate::ast::Macro
7758    };
7759    (match) => {
7760        $crate::ast::Match
7761    };
7762    (mod) => {
7763        $crate::ast::Mod
7764    };
7765    (move) => {
7766        $crate::ast::Move
7767    };
7768    (mut) => {
7769        $crate::ast::Mut
7770    };
7771    (not) => {
7772        $crate::ast::Not
7773    };
7774    (offsetof) => {
7775        $crate::ast::OffsetOf
7776    };
7777    (override) => {
7778        $crate::ast::Override
7779    };
7780    (priv) => {
7781        $crate::ast::Priv
7782    };
7783    (proc) => {
7784        $crate::ast::Proc
7785    };
7786    (pub) => {
7787        $crate::ast::Pub
7788    };
7789    (pure) => {
7790        $crate::ast::Pure
7791    };
7792    (ref) => {
7793        $crate::ast::Ref
7794    };
7795    (return) => {
7796        $crate::ast::Return
7797    };
7798    (select) => {
7799        $crate::ast::Select
7800    };
7801    (Self) => {
7802        $crate::ast::SelfType
7803    };
7804    (self) => {
7805        $crate::ast::SelfValue
7806    };
7807    (sizeof) => {
7808        $crate::ast::SizeOf
7809    };
7810    (static) => {
7811        $crate::ast::Static
7812    };
7813    (struct) => {
7814        $crate::ast::Struct
7815    };
7816    (super) => {
7817        $crate::ast::Super
7818    };
7819    (true) => {
7820        $crate::ast::True
7821    };
7822    (typeof) => {
7823        $crate::ast::TypeOf
7824    };
7825    (unsafe) => {
7826        $crate::ast::Unsafe
7827    };
7828    (use) => {
7829        $crate::ast::Use
7830    };
7831    (virtual) => {
7832        $crate::ast::Virtual
7833    };
7834    (while) => {
7835        $crate::ast::While
7836    };
7837    (yield) => {
7838        $crate::ast::Yield
7839    };
7840    (&) => {
7841        $crate::ast::Amp
7842    };
7843    (&&) => {
7844        $crate::ast::AmpAmp
7845    };
7846    (&=) => {
7847        $crate::ast::AmpEq
7848    };
7849    (->) => {
7850        $crate::ast::Arrow
7851    };
7852    (@) => {
7853        $crate::ast::At
7854    };
7855    (!) => {
7856        $crate::ast::Bang
7857    };
7858    (!=) => {
7859        $crate::ast::BangEq
7860    };
7861    (^) => {
7862        $crate::ast::Caret
7863    };
7864    (^=) => {
7865        $crate::ast::CaretEq
7866    };
7867    (:) => {
7868        $crate::ast::Colon
7869    };
7870    (::) => {
7871        $crate::ast::ColonColon
7872    };
7873    (,) => {
7874        $crate::ast::Comma
7875    };
7876    (-) => {
7877        $crate::ast::Dash
7878    };
7879    (-=) => {
7880        $crate::ast::DashEq
7881    };
7882    (/) => {
7883        $crate::ast::Div
7884    };
7885    ($) => {
7886        $crate::ast::Dollar
7887    };
7888    (.) => {
7889        $crate::ast::Dot
7890    };
7891    (..) => {
7892        $crate::ast::DotDot
7893    };
7894    (..=) => {
7895        $crate::ast::DotDotEq
7896    };
7897    (=) => {
7898        $crate::ast::Eq
7899    };
7900    (==) => {
7901        $crate::ast::EqEq
7902    };
7903    (>) => {
7904        $crate::ast::Gt
7905    };
7906    (>=) => {
7907        $crate::ast::GtEq
7908    };
7909    (>>) => {
7910        $crate::ast::GtGt
7911    };
7912    (>>=) => {
7913        $crate::ast::GtGtEq
7914    };
7915    (<) => {
7916        $crate::ast::Lt
7917    };
7918    (<=) => {
7919        $crate::ast::LtEq
7920    };
7921    (<<) => {
7922        $crate::ast::LtLt
7923    };
7924    (<<=) => {
7925        $crate::ast::LtLtEq
7926    };
7927    (%) => {
7928        $crate::ast::Perc
7929    };
7930    (%=) => {
7931        $crate::ast::PercEq
7932    };
7933    (|) => {
7934        $crate::ast::Pipe
7935    };
7936    (|=) => {
7937        $crate::ast::PipeEq
7938    };
7939    (||) => {
7940        $crate::ast::PipePipe
7941    };
7942    (+) => {
7943        $crate::ast::Plus
7944    };
7945    (+=) => {
7946        $crate::ast::PlusEq
7947    };
7948    (#) => {
7949        $crate::ast::Pound
7950    };
7951    (?) => {
7952        $crate::ast::QuestionMark
7953    };
7954    (=>) => {
7955        $crate::ast::Rocket
7956    };
7957    (;) => {
7958        $crate::ast::SemiColon
7959    };
7960    (/=) => {
7961        $crate::ast::SlashEq
7962    };
7963    (*) => {
7964        $crate::ast::Star
7965    };
7966    (*=) => {
7967        $crate::ast::StarEq
7968    };
7969    (~) => {
7970        $crate::ast::Tilde
7971    };
7972    (_) => {
7973        $crate::ast::Underscore
7974    };
7975}
7976
7977/// Helper macro to reference a specific token kind, or short sequence of kinds.
7978#[macro_export]
7979macro_rules! K {
7980    (#!($($tt:tt)*)) => { $crate::ast::Kind::Shebang($($tt)*) };
7981    (ident) => { $crate::ast::Kind::Ident(..) };
7982    (ident ($($tt:tt)*)) => { $crate::ast::Kind::Ident($($tt)*) };
7983    ('label) => { $crate::ast::Kind::Label(..) };
7984    ('label ($($tt:tt)*)) => { $crate::ast::Kind::Label($($tt)*) };
7985    (str) => { $crate::ast::Kind::Str(..) };
7986    (str ($($tt:tt)*)) => { $crate::ast::Kind::Str($($tt)*) };
7987    (bytestr) => { $crate::ast::Kind::ByteStr(..) };
7988    (bytestr ($($tt:tt)*)) => { $crate::ast::Kind::ByteStr($($tt)*) };
7989    (char) => { $crate::ast::Kind::Char(..) };
7990    (char ($($tt:tt)*)) => { $crate::ast::Kind::Char($($tt)*) };
7991    (byte) => { $crate::ast::Kind::Byte(..) };
7992    (byte ($($tt:tt)*)) => { $crate::ast::Kind::Byte($($tt)*) };
7993    (number) => { $crate::ast::Kind::Number(..) };
7994    (number ($($tt:tt)*)) => { $crate::ast::Kind::Number($($tt)*) };
7995    ('(') => { $crate::ast::Kind::Open($crate::ast::Delimiter::Parenthesis) };
7996    (')') => { $crate::ast::Kind::Close($crate::ast::Delimiter::Parenthesis) };
7997    ('[') => { $crate::ast::Kind::Open($crate::ast::Delimiter::Bracket) };
7998    (']') => { $crate::ast::Kind::Close($crate::ast::Delimiter::Bracket) };
7999    ('{') => { $crate::ast::Kind::Open($crate::ast::Delimiter::Brace) };
8000    ('}') => { $crate::ast::Kind::Close($crate::ast::Delimiter::Brace) };
8001    (abstract) => { $crate::ast::Kind::Abstract };
8002    (alignof) => { $crate::ast::Kind::AlignOf };
8003    (as) => { $crate::ast::Kind::As };
8004    (async) => { $crate::ast::Kind::Async };
8005    (await) => { $crate::ast::Kind::Await };
8006    (become) => { $crate::ast::Kind::Become };
8007    (break) => { $crate::ast::Kind::Break };
8008    (const) => { $crate::ast::Kind::Const };
8009    (continue) => { $crate::ast::Kind::Continue };
8010    (crate) => { $crate::ast::Kind::Crate };
8011    (default) => { $crate::ast::Kind::Default };
8012    (do) => { $crate::ast::Kind::Do };
8013    (else) => { $crate::ast::Kind::Else };
8014    (enum) => { $crate::ast::Kind::Enum };
8015    (extern) => { $crate::ast::Kind::Extern };
8016    (false) => { $crate::ast::Kind::False };
8017    (final) => { $crate::ast::Kind::Final };
8018    (fn) => { $crate::ast::Kind::Fn };
8019    (for) => { $crate::ast::Kind::For };
8020    (if) => { $crate::ast::Kind::If };
8021    (impl) => { $crate::ast::Kind::Impl };
8022    (in) => { $crate::ast::Kind::In };
8023    (is) => { $crate::ast::Kind::Is };
8024    (let) => { $crate::ast::Kind::Let };
8025    (loop) => { $crate::ast::Kind::Loop };
8026    (macro) => { $crate::ast::Kind::Macro };
8027    (match) => { $crate::ast::Kind::Match };
8028    (mod) => { $crate::ast::Kind::Mod };
8029    (move) => { $crate::ast::Kind::Move };
8030    (mut) => { $crate::ast::Kind::Mut };
8031    (not) => { $crate::ast::Kind::Not };
8032    (offsetof) => { $crate::ast::Kind::OffsetOf };
8033    (override) => { $crate::ast::Kind::Override };
8034    (priv) => { $crate::ast::Kind::Priv };
8035    (proc) => { $crate::ast::Kind::Proc };
8036    (pub) => { $crate::ast::Kind::Pub };
8037    (pure) => { $crate::ast::Kind::Pure };
8038    (ref) => { $crate::ast::Kind::Ref };
8039    (return) => { $crate::ast::Kind::Return };
8040    (select) => { $crate::ast::Kind::Select };
8041    (Self) => { $crate::ast::Kind::SelfType };
8042    (self) => { $crate::ast::Kind::SelfValue };
8043    (sizeof) => { $crate::ast::Kind::SizeOf };
8044    (static) => { $crate::ast::Kind::Static };
8045    (struct) => { $crate::ast::Kind::Struct };
8046    (super) => { $crate::ast::Kind::Super };
8047    (true) => { $crate::ast::Kind::True };
8048    (typeof) => { $crate::ast::Kind::TypeOf };
8049    (unsafe) => { $crate::ast::Kind::Unsafe };
8050    (use) => { $crate::ast::Kind::Use };
8051    (virtual) => { $crate::ast::Kind::Virtual };
8052    (while) => { $crate::ast::Kind::While };
8053    (yield) => { $crate::ast::Kind::Yield };
8054    (&) => { $crate::ast::Kind::Amp };
8055    (&&) => { $crate::ast::Kind::AmpAmp };
8056    (&=) => { $crate::ast::Kind::AmpEq };
8057    (->) => { $crate::ast::Kind::Arrow };
8058    (@) => { $crate::ast::Kind::At };
8059    (!) => { $crate::ast::Kind::Bang };
8060    (!=) => { $crate::ast::Kind::BangEq };
8061    (^) => { $crate::ast::Kind::Caret };
8062    (^=) => { $crate::ast::Kind::CaretEq };
8063    (:) => { $crate::ast::Kind::Colon };
8064    (::) => { $crate::ast::Kind::ColonColon };
8065    (,) => { $crate::ast::Kind::Comma };
8066    (-) => { $crate::ast::Kind::Dash };
8067    (-=) => { $crate::ast::Kind::DashEq };
8068    (/) => { $crate::ast::Kind::Div };
8069    ($) => { $crate::ast::Kind::Dollar };
8070    (.) => { $crate::ast::Kind::Dot };
8071    (..) => { $crate::ast::Kind::DotDot };
8072    (..=) => { $crate::ast::Kind::DotDotEq };
8073    (=) => { $crate::ast::Kind::Eq };
8074    (==) => { $crate::ast::Kind::EqEq };
8075    (>) => { $crate::ast::Kind::Gt };
8076    (>=) => { $crate::ast::Kind::GtEq };
8077    (>>) => { $crate::ast::Kind::GtGt };
8078    (>>=) => { $crate::ast::Kind::GtGtEq };
8079    (<) => { $crate::ast::Kind::Lt };
8080    (<=) => { $crate::ast::Kind::LtEq };
8081    (<<) => { $crate::ast::Kind::LtLt };
8082    (<<=) => { $crate::ast::Kind::LtLtEq };
8083    (%) => { $crate::ast::Kind::Perc };
8084    (%=) => { $crate::ast::Kind::PercEq };
8085    (|) => { $crate::ast::Kind::Pipe };
8086    (|=) => { $crate::ast::Kind::PipeEq };
8087    (||) => { $crate::ast::Kind::PipePipe };
8088    (+) => { $crate::ast::Kind::Plus };
8089    (+=) => { $crate::ast::Kind::PlusEq };
8090    (#) => { $crate::ast::Kind::Pound };
8091    (?) => { $crate::ast::Kind::QuestionMark };
8092    (=>) => { $crate::ast::Kind::Rocket };
8093    (;) => { $crate::ast::Kind::SemiColon };
8094    (/=) => { $crate::ast::Kind::SlashEq };
8095    (*) => { $crate::ast::Kind::Star };
8096    (*=) => { $crate::ast::Kind::StarEq };
8097    (~) => { $crate::ast::Kind::Tilde };
8098    (_) => { $crate::ast::Kind::Underscore };
8099}
8100
8101/// The kind of the token.
8102#[derive(Debug, clone::TryClone, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
8103pub enum Kind {
8104    /// En end-of-file marker.
8105    Eof,
8106    /// A single-line comment.
8107    Comment,
8108    /// A multiline comment where the boolean indicates if it's been terminated correctly.
8109    MultilineComment(bool),
8110    /// En error marker.
8111    Error,
8112    /// The special initial line of a file shebang.
8113    Shebang(ast::LitSource),
8114    /// A close delimiter: `)`, `}`, or `]`.
8115    Close(ast::Delimiter),
8116    /// An open delimiter: `(`, `{`, or `[`.
8117    Open(ast::Delimiter),
8118    /// An identifier.
8119    Ident(ast::LitSource),
8120    /// A label, like `'loop`.
8121    Label(ast::LitSource),
8122    /// A byte literal.
8123    Byte(ast::CopySource<u8>),
8124    /// A byte string literal, including escape sequences. Like `b"hello\nworld"`.
8125    ByteStr(ast::StrSource),
8126    /// A characer literal.
8127    Char(ast::CopySource<char>),
8128    /// A number literal, like `42` or `3.14` or `0xff`.
8129    Number(ast::NumberSource),
8130    /// A string literal, including escape sequences. Like `"hello\nworld"`.
8131    Str(ast::StrSource),
8132    /// A path with an associated item.
8133    IndexedPath(compile::ItemId),
8134    /// A constant block with an associated item.
8135    ConstBlock(compile::ItemId),
8136    /// An asynchronous block with an associated item.
8137    AsyncBlock(compile::ItemId),
8138    /// An indexed closure.
8139    Closure(compile::ItemId),
8140    /// An expanded macro.
8141    ExpandedMacro(parse::NonZeroId),
8142    /// The `abstract` keyword.
8143    Abstract,
8144    /// The `alignof` keyword.
8145    AlignOf,
8146    /// `&`.
8147    Amp,
8148    /// `&&`.
8149    AmpAmp,
8150    /// `&=`.
8151    AmpEq,
8152    /// `->`.
8153    Arrow,
8154    /// The `as` keyword.
8155    As,
8156    /// The `async` keyword.
8157    Async,
8158    /// `@`.
8159    At,
8160    /// The `await` keyword.
8161    Await,
8162    /// `!`.
8163    Bang,
8164    /// `!=`.
8165    BangEq,
8166    /// The `become` keyword.
8167    Become,
8168    /// The `break` keyword.
8169    Break,
8170    /// `^`.
8171    Caret,
8172    /// `^=`.
8173    CaretEq,
8174    /// `:`.
8175    Colon,
8176    /// `::`.
8177    ColonColon,
8178    /// `,`.
8179    Comma,
8180    /// The `const` keyword.
8181    Const,
8182    /// The `continue` keyword.
8183    Continue,
8184    /// The `crate` keyword.
8185    Crate,
8186    /// `-`.
8187    Dash,
8188    /// `-=`.
8189    DashEq,
8190    /// The `default` keyword.
8191    Default,
8192    /// `/`.
8193    Div,
8194    /// The `do` keyword.
8195    Do,
8196    /// `$`.
8197    Dollar,
8198    /// `.`.
8199    Dot,
8200    /// `..`.
8201    DotDot,
8202    /// `..=`.
8203    DotDotEq,
8204    /// The `else` keyword.
8205    Else,
8206    /// The `enum` keyword.
8207    Enum,
8208    /// `=`.
8209    Eq,
8210    /// `==`.
8211    EqEq,
8212    /// The `extern` keyword.
8213    Extern,
8214    /// The `false` keyword.
8215    False,
8216    /// The `final` keyword.
8217    Final,
8218    /// The `fn` keyword.
8219    Fn,
8220    /// The `for` keyword.
8221    For,
8222    /// `>`.
8223    Gt,
8224    /// `>=`.
8225    GtEq,
8226    /// `>>`.
8227    GtGt,
8228    /// `>>=`.
8229    GtGtEq,
8230    /// The `if` keyword.
8231    If,
8232    /// The `impl` keyword.
8233    Impl,
8234    /// The `in` keyword.
8235    In,
8236    /// The `is` keyword.
8237    Is,
8238    /// The `let` keyword.
8239    Let,
8240    /// The `loop` keyword.
8241    Loop,
8242    /// `<`.
8243    Lt,
8244    /// `<=`.
8245    LtEq,
8246    /// `<<`.
8247    LtLt,
8248    /// `<<=`.
8249    LtLtEq,
8250    /// The `macro` keyword.
8251    Macro,
8252    /// The `match` keyword.
8253    Match,
8254    /// The `mod` keyword.
8255    Mod,
8256    /// The `move` keyword.
8257    Move,
8258    /// The `mut` keyword.
8259    Mut,
8260    /// The `not` keyword.
8261    Not,
8262    /// The `offsetof` keyword.
8263    OffsetOf,
8264    /// The `override` keyword.
8265    Override,
8266    /// `%`.
8267    Perc,
8268    /// `%=`.
8269    PercEq,
8270    /// `|`.
8271    Pipe,
8272    /// |=`.
8273    PipeEq,
8274    /// `||`.
8275    PipePipe,
8276    /// `+`.
8277    Plus,
8278    /// `+=`.
8279    PlusEq,
8280    /// `#`.
8281    Pound,
8282    /// The `priv` keyword.
8283    Priv,
8284    /// The `proc` keyword.
8285    Proc,
8286    /// The `pub` keyword.
8287    Pub,
8288    /// The `pure` keyword.
8289    Pure,
8290    /// `?`.
8291    QuestionMark,
8292    /// The `ref` keyword.
8293    Ref,
8294    /// The `return` keyword.
8295    Return,
8296    /// `=>`.
8297    Rocket,
8298    /// The `select` keyword.
8299    Select,
8300    /// The `Self` keyword.
8301    SelfType,
8302    /// The `self` keyword.
8303    SelfValue,
8304    /// `;`.
8305    SemiColon,
8306    /// The `sizeof` keyword.
8307    SizeOf,
8308    /// `/=`.
8309    SlashEq,
8310    /// `*`.
8311    Star,
8312    /// `*=`.
8313    StarEq,
8314    /// The `static` keyword.
8315    Static,
8316    /// The `struct` keyword.
8317    Struct,
8318    /// The `super` keyword.
8319    Super,
8320    /// `~`.
8321    Tilde,
8322    /// The `true` keyword.
8323    True,
8324    /// The `typeof` keyword.
8325    TypeOf,
8326    /// `_`.
8327    Underscore,
8328    /// The `unsafe` keyword.
8329    Unsafe,
8330    /// The `use` keyword.
8331    Use,
8332    /// The `virtual` keyword.
8333    Virtual,
8334    /// The `while` keyword.
8335    While,
8336    /// The `yield` keyword.
8337    Yield,
8338    /// whitespace.
8339    Whitespace,
8340    /// a syntax root
8341    Root,
8342    /// a variable declaration
8343    Local,
8344    /// an item declaration
8345    Item,
8346    /// an enum declaration
8347    ItemEnum,
8348    /// a struct declaration
8349    ItemStruct,
8350    /// a constant item
8351    ItemConst,
8352    /// a function declaration
8353    ItemFn,
8354    /// an impl
8355    ItemImpl,
8356    /// a module declaration
8357    ItemMod,
8358    /// a file module declaration
8359    ItemFileMod,
8360    /// a use declaration
8361    ItemUse,
8362    /// a nested use path
8363    ItemUsePath,
8364    /// a nested use group
8365    ItemUseGroup,
8366    /// a variant
8367    Variant,
8368    /// a field declaration
8369    Field,
8370    /// an empty type body
8371    EmptyBody,
8372    /// a struct body
8373    StructBody,
8374    /// a tuple body
8375    TupleBody,
8376    /// a collection of function arguments
8377    FnArgs,
8378    /// a block
8379    Block,
8380    /// the body of a block
8381    BlockBody,
8382    /// an expression
8383    Expr,
8384    /// a chain of expressions
8385    ExprChain,
8386    /// a tuple expression
8387    ExprTuple,
8388    /// an array expression
8389    ExprArray,
8390    /// a unary expression
8391    ExprUnary,
8392    /// a binary expression
8393    ExprBinary,
8394    /// a group expression
8395    ExprGroup,
8396    /// an empty group expression
8397    ExprEmptyGroup,
8398    /// a try expression
8399    ExprTry,
8400    /// an indexing expression
8401    ExprIndex,
8402    /// a call expression
8403    ExprCall,
8404    /// a macro call expression
8405    ExprMacroCall,
8406    /// an anonymous object expression
8407    ExprObject,
8408    /// a match expression
8409    ExprMatch,
8410    /// a match arm
8411    ExprMatchArm,
8412    /// a select expression
8413    ExprSelect,
8414    /// a select arm
8415    ExprSelectArm,
8416    /// an `.await` expression
8417    ExprAwait,
8418    /// a field expression
8419    ExprField,
8420    /// the operator in an expression
8421    ExprOperator,
8422    /// an `if` expression
8423    ExprIf,
8424    /// the `else` part of an if-expression
8425    ExprElse,
8426    /// the `else if` part of an if-expression
8427    ExprElseIf,
8428    /// a `while` expression
8429    ExprWhile,
8430    /// a `loop` expression
8431    ExprLoop,
8432    /// a `break` expression
8433    ExprBreak,
8434    /// a `break` expression
8435    ExprContinue,
8436    /// a `return` expression
8437    ExprReturn,
8438    /// a `yield` expression
8439    ExprYield,
8440    /// a `for` expression
8441    ExprFor,
8442    /// a `<start>..<end>` expression
8443    ExprRange,
8444    /// a `<start>..=<end>` expression
8445    ExprRangeInclusive,
8446    /// a `..<end>` expression
8447    ExprRangeTo,
8448    /// a `..=<end>` expression
8449    ExprRangeToInclusive,
8450    /// a `<start>..` expression
8451    ExprRangeFrom,
8452    /// a `..` expression
8453    ExprRangeFull,
8454    /// an assign expression
8455    ExprAssign,
8456    /// a literal value
8457    Lit,
8458    /// a closure expression
8459    ExprClosure,
8460    /// a pattern
8461    Pat,
8462    /// an array pattern
8463    PatArray,
8464    /// a tuple pattern
8465    PatTuple,
8466    /// an object pattern
8467    PatObject,
8468    /// an ignore pattern
8469    PatIgnore,
8470    /// a path
8471    Path,
8472    /// the generics of a path
8473    PathGenerics,
8474    /// the `let` condition of a loop
8475    Condition,
8476    /// closure arguments
8477    ClosureArguments,
8478    /// an `#{` anonymous object key
8479    AnonymousObjectKey,
8480    /// an attribute
8481    Attribute,
8482    /// an inner attribute
8483    InnerAttribute,
8484    /// modifiers
8485    Modifiers,
8486    /// the `(super)` modifier
8487    ModifierSuper,
8488    /// the `(self)` modifier
8489    ModifierSelf,
8490    /// the `(crate)` modifier
8491    ModifierCrate,
8492    /// the `(in <path>)` modifier
8493    ModifierIn,
8494    /// a raw token stream
8495    TokenStream,
8496    /// a raw token stream
8497    TemplateString,
8498}
8499
8500impl From<ast::Token> for Kind {
8501    fn from(token: ast::Token) -> Self {
8502        token.kind
8503    }
8504}
8505
8506impl Kind {
8507    /// Try to convert an identifier into a keyword.
8508    pub(crate) fn from_keyword(ident: &str) -> Option<Self> {
8509        match ident {
8510            "abstract" => Some(Self::Abstract),
8511            "alignof" => Some(Self::AlignOf),
8512            "as" => Some(Self::As),
8513            "async" => Some(Self::Async),
8514            "await" => Some(Self::Await),
8515            "become" => Some(Self::Become),
8516            "break" => Some(Self::Break),
8517            "const" => Some(Self::Const),
8518            "continue" => Some(Self::Continue),
8519            "crate" => Some(Self::Crate),
8520            "default" => Some(Self::Default),
8521            "do" => Some(Self::Do),
8522            "else" => Some(Self::Else),
8523            "enum" => Some(Self::Enum),
8524            "extern" => Some(Self::Extern),
8525            "false" => Some(Self::False),
8526            "final" => Some(Self::Final),
8527            "fn" => Some(Self::Fn),
8528            "for" => Some(Self::For),
8529            "if" => Some(Self::If),
8530            "impl" => Some(Self::Impl),
8531            "in" => Some(Self::In),
8532            "is" => Some(Self::Is),
8533            "let" => Some(Self::Let),
8534            "loop" => Some(Self::Loop),
8535            "macro" => Some(Self::Macro),
8536            "match" => Some(Self::Match),
8537            "mod" => Some(Self::Mod),
8538            "move" => Some(Self::Move),
8539            "mut" => Some(Self::Mut),
8540            "not" => Some(Self::Not),
8541            "offsetof" => Some(Self::OffsetOf),
8542            "override" => Some(Self::Override),
8543            "priv" => Some(Self::Priv),
8544            "proc" => Some(Self::Proc),
8545            "pub" => Some(Self::Pub),
8546            "pure" => Some(Self::Pure),
8547            "ref" => Some(Self::Ref),
8548            "return" => Some(Self::Return),
8549            "select" => Some(Self::Select),
8550            "Self" => Some(Self::SelfType),
8551            "self" => Some(Self::SelfValue),
8552            "sizeof" => Some(Self::SizeOf),
8553            "static" => Some(Self::Static),
8554            "struct" => Some(Self::Struct),
8555            "super" => Some(Self::Super),
8556            "true" => Some(Self::True),
8557            "typeof" => Some(Self::TypeOf),
8558            "unsafe" => Some(Self::Unsafe),
8559            "use" => Some(Self::Use),
8560            "virtual" => Some(Self::Virtual),
8561            "while" => Some(Self::While),
8562            "yield" => Some(Self::Yield),
8563            _ => None,
8564        }
8565    }
8566
8567    /// If applicable, convert this into a literal.
8568    pub(crate) fn as_literal_str(&self) -> Option<&'static str> {
8569        match self {
8570            Self::Close(d) => Some(d.close()),
8571            Self::Open(d) => Some(d.open()),
8572            Self::Abstract => Some("abstract"),
8573            Self::AlignOf => Some("alignof"),
8574            Self::As => Some("as"),
8575            Self::Async => Some("async"),
8576            Self::Await => Some("await"),
8577            Self::Become => Some("become"),
8578            Self::Break => Some("break"),
8579            Self::Const => Some("const"),
8580            Self::Continue => Some("continue"),
8581            Self::Crate => Some("crate"),
8582            Self::Default => Some("default"),
8583            Self::Do => Some("do"),
8584            Self::Else => Some("else"),
8585            Self::Enum => Some("enum"),
8586            Self::Extern => Some("extern"),
8587            Self::False => Some("false"),
8588            Self::Final => Some("final"),
8589            Self::Fn => Some("fn"),
8590            Self::For => Some("for"),
8591            Self::If => Some("if"),
8592            Self::Impl => Some("impl"),
8593            Self::In => Some("in"),
8594            Self::Is => Some("is"),
8595            Self::Let => Some("let"),
8596            Self::Loop => Some("loop"),
8597            Self::Macro => Some("macro"),
8598            Self::Match => Some("match"),
8599            Self::Mod => Some("mod"),
8600            Self::Move => Some("move"),
8601            Self::Mut => Some("mut"),
8602            Self::Not => Some("not"),
8603            Self::OffsetOf => Some("offsetof"),
8604            Self::Override => Some("override"),
8605            Self::Priv => Some("priv"),
8606            Self::Proc => Some("proc"),
8607            Self::Pub => Some("pub"),
8608            Self::Pure => Some("pure"),
8609            Self::Ref => Some("ref"),
8610            Self::Return => Some("return"),
8611            Self::Select => Some("select"),
8612            Self::SelfType => Some("Self"),
8613            Self::SelfValue => Some("self"),
8614            Self::SizeOf => Some("sizeof"),
8615            Self::Static => Some("static"),
8616            Self::Struct => Some("struct"),
8617            Self::Super => Some("super"),
8618            Self::True => Some("true"),
8619            Self::TypeOf => Some("typeof"),
8620            Self::Unsafe => Some("unsafe"),
8621            Self::Use => Some("use"),
8622            Self::Virtual => Some("virtual"),
8623            Self::While => Some("while"),
8624            Self::Yield => Some("yield"),
8625            Self::Amp => Some("&"),
8626            Self::AmpAmp => Some("&&"),
8627            Self::AmpEq => Some("&="),
8628            Self::Arrow => Some("->"),
8629            Self::At => Some("@"),
8630            Self::Bang => Some("!"),
8631            Self::BangEq => Some("!="),
8632            Self::Caret => Some("^"),
8633            Self::CaretEq => Some("^="),
8634            Self::Colon => Some(":"),
8635            Self::ColonColon => Some("::"),
8636            Self::Comma => Some(","),
8637            Self::Dash => Some("-"),
8638            Self::DashEq => Some("-="),
8639            Self::Div => Some("/"),
8640            Self::Dollar => Some("$"),
8641            Self::Dot => Some("."),
8642            Self::DotDot => Some(".."),
8643            Self::DotDotEq => Some("..="),
8644            Self::Eq => Some("="),
8645            Self::EqEq => Some("=="),
8646            Self::Gt => Some(">"),
8647            Self::GtEq => Some(">="),
8648            Self::GtGt => Some(">>"),
8649            Self::GtGtEq => Some(">>="),
8650            Self::Lt => Some("<"),
8651            Self::LtEq => Some("<="),
8652            Self::LtLt => Some("<<"),
8653            Self::LtLtEq => Some("<<="),
8654            Self::Perc => Some("%"),
8655            Self::PercEq => Some("%="),
8656            Self::Pipe => Some("|"),
8657            Self::PipeEq => Some("|="),
8658            Self::PipePipe => Some("||"),
8659            Self::Plus => Some("+"),
8660            Self::PlusEq => Some("+="),
8661            Self::Pound => Some("#"),
8662            Self::QuestionMark => Some("?"),
8663            Self::Rocket => Some("=>"),
8664            Self::SemiColon => Some(";"),
8665            Self::SlashEq => Some("/="),
8666            Self::Star => Some("*"),
8667            Self::StarEq => Some("*="),
8668            Self::Tilde => Some("~"),
8669            Self::Underscore => Some("_"),
8670            _ => None,
8671        }
8672    }
8673}
8674
8675impl fmt::Display for Kind {
8676    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
8677        parse::IntoExpectation::into_expectation(*self).fmt(f)
8678    }
8679}
8680
8681impl macros::ToTokens for Kind {
8682    fn to_tokens(
8683        &self,
8684        context: &mut macros::MacroContext<'_, '_, '_>,
8685        stream: &mut macros::TokenStream,
8686    ) -> crate::alloc::Result<()> {
8687        stream.push(ast::Token {
8688            kind: *self,
8689            span: context.macro_span(),
8690        })
8691    }
8692}
8693
8694impl parse::IntoExpectation for Kind {
8695    fn into_expectation(self) -> parse::Expectation {
8696        match self {
8697            Self::Eof => parse::Expectation::Description("eof"),
8698            Self::Comment | Self::MultilineComment(..) => parse::Expectation::Comment,
8699            Self::Error => parse::Expectation::Description("an error"),
8700            Self::Shebang { .. } => parse::Expectation::Description("a shebang"),
8701            Self::Ident(..) => parse::Expectation::Description("an identifier"),
8702            Self::Label(..) => parse::Expectation::Description("a label"),
8703            Self::Byte { .. } => parse::Expectation::Description("a byte literal"),
8704            Self::ByteStr { .. } => parse::Expectation::Description("a byte string literal"),
8705            Self::Char { .. } => parse::Expectation::Description("a character"),
8706            Self::Number { .. } => parse::Expectation::Description("a number"),
8707            Self::Str { .. } => parse::Expectation::Description("a string literal"),
8708            Self::Close(delimiter) => parse::Expectation::Delimiter(delimiter.close()),
8709            Self::Open(delimiter) => parse::Expectation::Delimiter(delimiter.open()),
8710            Self::IndexedPath(..) => parse::Expectation::Syntax("an indexed path"),
8711            Self::ConstBlock(..) => parse::Expectation::Syntax("a constant block"),
8712            Self::AsyncBlock(..) => parse::Expectation::Syntax("an asynchronous block"),
8713            Self::Closure(..) => parse::Expectation::Syntax("a closure"),
8714            Self::ExpandedMacro(..) => parse::Expectation::Syntax("an expanded macro"),
8715            Self::Abstract => parse::Expectation::Keyword("abstract"),
8716            Self::AlignOf => parse::Expectation::Keyword("alignof"),
8717            Self::As => parse::Expectation::Keyword("as"),
8718            Self::Async => parse::Expectation::Keyword("async"),
8719            Self::Await => parse::Expectation::Keyword("await"),
8720            Self::Become => parse::Expectation::Keyword("become"),
8721            Self::Break => parse::Expectation::Keyword("break"),
8722            Self::Const => parse::Expectation::Keyword("const"),
8723            Self::Continue => parse::Expectation::Keyword("continue"),
8724            Self::Crate => parse::Expectation::Keyword("crate"),
8725            Self::Default => parse::Expectation::Keyword("default"),
8726            Self::Do => parse::Expectation::Keyword("do"),
8727            Self::Else => parse::Expectation::Keyword("else"),
8728            Self::Enum => parse::Expectation::Keyword("enum"),
8729            Self::Extern => parse::Expectation::Keyword("extern"),
8730            Self::False => parse::Expectation::Keyword("false"),
8731            Self::Final => parse::Expectation::Keyword("final"),
8732            Self::Fn => parse::Expectation::Keyword("fn"),
8733            Self::For => parse::Expectation::Keyword("for"),
8734            Self::If => parse::Expectation::Keyword("if"),
8735            Self::Impl => parse::Expectation::Keyword("impl"),
8736            Self::In => parse::Expectation::Keyword("in"),
8737            Self::Is => parse::Expectation::Keyword("is"),
8738            Self::Let => parse::Expectation::Keyword("let"),
8739            Self::Loop => parse::Expectation::Keyword("loop"),
8740            Self::Macro => parse::Expectation::Keyword("macro"),
8741            Self::Match => parse::Expectation::Keyword("match"),
8742            Self::Mod => parse::Expectation::Keyword("mod"),
8743            Self::Move => parse::Expectation::Keyword("move"),
8744            Self::Mut => parse::Expectation::Keyword("mut"),
8745            Self::Not => parse::Expectation::Keyword("not"),
8746            Self::OffsetOf => parse::Expectation::Keyword("offsetof"),
8747            Self::Override => parse::Expectation::Keyword("override"),
8748            Self::Priv => parse::Expectation::Keyword("priv"),
8749            Self::Proc => parse::Expectation::Keyword("proc"),
8750            Self::Pub => parse::Expectation::Keyword("pub"),
8751            Self::Pure => parse::Expectation::Keyword("pure"),
8752            Self::Ref => parse::Expectation::Keyword("ref"),
8753            Self::Return => parse::Expectation::Keyword("return"),
8754            Self::Select => parse::Expectation::Keyword("select"),
8755            Self::SelfType => parse::Expectation::Keyword("Self"),
8756            Self::SelfValue => parse::Expectation::Keyword("self"),
8757            Self::SizeOf => parse::Expectation::Keyword("sizeof"),
8758            Self::Static => parse::Expectation::Keyword("static"),
8759            Self::Struct => parse::Expectation::Keyword("struct"),
8760            Self::Super => parse::Expectation::Keyword("super"),
8761            Self::True => parse::Expectation::Keyword("true"),
8762            Self::TypeOf => parse::Expectation::Keyword("typeof"),
8763            Self::Unsafe => parse::Expectation::Keyword("unsafe"),
8764            Self::Use => parse::Expectation::Keyword("use"),
8765            Self::Virtual => parse::Expectation::Keyword("virtual"),
8766            Self::While => parse::Expectation::Keyword("while"),
8767            Self::Yield => parse::Expectation::Keyword("yield"),
8768            Self::Amp => parse::Expectation::Punctuation("&"),
8769            Self::AmpAmp => parse::Expectation::Punctuation("&&"),
8770            Self::AmpEq => parse::Expectation::Punctuation("&="),
8771            Self::Arrow => parse::Expectation::Punctuation("->"),
8772            Self::At => parse::Expectation::Punctuation("@"),
8773            Self::Bang => parse::Expectation::Punctuation("!"),
8774            Self::BangEq => parse::Expectation::Punctuation("!="),
8775            Self::Caret => parse::Expectation::Punctuation("^"),
8776            Self::CaretEq => parse::Expectation::Punctuation("^="),
8777            Self::Colon => parse::Expectation::Punctuation(":"),
8778            Self::ColonColon => parse::Expectation::Punctuation("::"),
8779            Self::Comma => parse::Expectation::Punctuation(","),
8780            Self::Dash => parse::Expectation::Punctuation("-"),
8781            Self::DashEq => parse::Expectation::Punctuation("-="),
8782            Self::Div => parse::Expectation::Punctuation("/"),
8783            Self::Dollar => parse::Expectation::Punctuation("$"),
8784            Self::Dot => parse::Expectation::Punctuation("."),
8785            Self::DotDot => parse::Expectation::Punctuation(".."),
8786            Self::DotDotEq => parse::Expectation::Punctuation("..="),
8787            Self::Eq => parse::Expectation::Punctuation("="),
8788            Self::EqEq => parse::Expectation::Punctuation("=="),
8789            Self::Gt => parse::Expectation::Punctuation(">"),
8790            Self::GtEq => parse::Expectation::Punctuation(">="),
8791            Self::GtGt => parse::Expectation::Punctuation(">>"),
8792            Self::GtGtEq => parse::Expectation::Punctuation(">>="),
8793            Self::Lt => parse::Expectation::Punctuation("<"),
8794            Self::LtEq => parse::Expectation::Punctuation("<="),
8795            Self::LtLt => parse::Expectation::Punctuation("<<"),
8796            Self::LtLtEq => parse::Expectation::Punctuation("<<="),
8797            Self::Perc => parse::Expectation::Punctuation("%"),
8798            Self::PercEq => parse::Expectation::Punctuation("%="),
8799            Self::Pipe => parse::Expectation::Punctuation("|"),
8800            Self::PipeEq => parse::Expectation::Punctuation("|="),
8801            Self::PipePipe => parse::Expectation::Punctuation("||"),
8802            Self::Plus => parse::Expectation::Punctuation("+"),
8803            Self::PlusEq => parse::Expectation::Punctuation("+="),
8804            Self::Pound => parse::Expectation::Punctuation("#"),
8805            Self::QuestionMark => parse::Expectation::Punctuation("?"),
8806            Self::Rocket => parse::Expectation::Punctuation("=>"),
8807            Self::SemiColon => parse::Expectation::Punctuation(";"),
8808            Self::SlashEq => parse::Expectation::Punctuation("/="),
8809            Self::Star => parse::Expectation::Punctuation("*"),
8810            Self::StarEq => parse::Expectation::Punctuation("*="),
8811            Self::Tilde => parse::Expectation::Punctuation("~"),
8812            Self::Underscore => parse::Expectation::Punctuation("_"),
8813            Self::Whitespace => parse::Expectation::Syntax("whitespace."),
8814            Self::Root => parse::Expectation::Syntax("a syntax root"),
8815            Self::Local => parse::Expectation::Syntax("a variable declaration"),
8816            Self::Item => parse::Expectation::Syntax("an item declaration"),
8817            Self::ItemEnum => parse::Expectation::Syntax("an enum declaration"),
8818            Self::ItemStruct => parse::Expectation::Syntax("a struct declaration"),
8819            Self::ItemConst => parse::Expectation::Syntax("a constant item"),
8820            Self::ItemFn => parse::Expectation::Syntax("a function declaration"),
8821            Self::ItemImpl => parse::Expectation::Syntax("an impl"),
8822            Self::ItemMod => parse::Expectation::Syntax("a module declaration"),
8823            Self::ItemFileMod => parse::Expectation::Syntax("a file module declaration"),
8824            Self::ItemUse => parse::Expectation::Syntax("a use declaration"),
8825            Self::ItemUsePath => parse::Expectation::Syntax("a nested use path"),
8826            Self::ItemUseGroup => parse::Expectation::Syntax("a nested use group"),
8827            Self::Variant => parse::Expectation::Syntax("a variant"),
8828            Self::Field => parse::Expectation::Syntax("a field declaration"),
8829            Self::EmptyBody => parse::Expectation::Syntax("an empty type body"),
8830            Self::StructBody => parse::Expectation::Syntax("a struct body"),
8831            Self::TupleBody => parse::Expectation::Syntax("a tuple body"),
8832            Self::FnArgs => parse::Expectation::Syntax("a collection of function arguments"),
8833            Self::Block => parse::Expectation::Syntax("a block"),
8834            Self::BlockBody => parse::Expectation::Syntax("the body of a block"),
8835            Self::Expr => parse::Expectation::Syntax("an expression"),
8836            Self::ExprChain => parse::Expectation::Syntax("a chain of expressions"),
8837            Self::ExprTuple => parse::Expectation::Syntax("a tuple expression"),
8838            Self::ExprArray => parse::Expectation::Syntax("an array expression"),
8839            Self::ExprUnary => parse::Expectation::Syntax("a unary expression"),
8840            Self::ExprBinary => parse::Expectation::Syntax("a binary expression"),
8841            Self::ExprGroup => parse::Expectation::Syntax("a group expression"),
8842            Self::ExprEmptyGroup => parse::Expectation::Syntax("an empty group expression"),
8843            Self::ExprTry => parse::Expectation::Syntax("a try expression"),
8844            Self::ExprIndex => parse::Expectation::Syntax("an indexing expression"),
8845            Self::ExprCall => parse::Expectation::Syntax("a call expression"),
8846            Self::ExprMacroCall => parse::Expectation::Syntax("a macro call expression"),
8847            Self::ExprObject => parse::Expectation::Syntax("an anonymous object expression"),
8848            Self::ExprMatch => parse::Expectation::Syntax("a match expression"),
8849            Self::ExprMatchArm => parse::Expectation::Syntax("a match arm"),
8850            Self::ExprSelect => parse::Expectation::Syntax("a select expression"),
8851            Self::ExprSelectArm => parse::Expectation::Syntax("a select arm"),
8852            Self::ExprAwait => parse::Expectation::Syntax("an `.await` expression"),
8853            Self::ExprField => parse::Expectation::Syntax("a field expression"),
8854            Self::ExprOperator => parse::Expectation::Syntax("the operator in an expression"),
8855            Self::ExprIf => parse::Expectation::Syntax("an `if` expression"),
8856            Self::ExprElse => parse::Expectation::Syntax("the `else` part of an if-expression"),
8857            Self::ExprElseIf => {
8858                parse::Expectation::Syntax("the `else if` part of an if-expression")
8859            }
8860            Self::ExprWhile => parse::Expectation::Syntax("a `while` expression"),
8861            Self::ExprLoop => parse::Expectation::Syntax("a `loop` expression"),
8862            Self::ExprBreak => parse::Expectation::Syntax("a `break` expression"),
8863            Self::ExprContinue => parse::Expectation::Syntax("a `break` expression"),
8864            Self::ExprReturn => parse::Expectation::Syntax("a `return` expression"),
8865            Self::ExprYield => parse::Expectation::Syntax("a `yield` expression"),
8866            Self::ExprFor => parse::Expectation::Syntax("a `for` expression"),
8867            Self::ExprRange => parse::Expectation::Syntax("a `<start>..<end>` expression"),
8868            Self::ExprRangeInclusive => {
8869                parse::Expectation::Syntax("a `<start>..=<end>` expression")
8870            }
8871            Self::ExprRangeTo => parse::Expectation::Syntax("a `..<end>` expression"),
8872            Self::ExprRangeToInclusive => parse::Expectation::Syntax("a `..=<end>` expression"),
8873            Self::ExprRangeFrom => parse::Expectation::Syntax("a `<start>..` expression"),
8874            Self::ExprRangeFull => parse::Expectation::Syntax("a `..` expression"),
8875            Self::ExprAssign => parse::Expectation::Syntax("an assign expression"),
8876            Self::Lit => parse::Expectation::Syntax("a literal value"),
8877            Self::ExprClosure => parse::Expectation::Syntax("a closure expression"),
8878            Self::Pat => parse::Expectation::Syntax("a pattern"),
8879            Self::PatArray => parse::Expectation::Syntax("an array pattern"),
8880            Self::PatTuple => parse::Expectation::Syntax("a tuple pattern"),
8881            Self::PatObject => parse::Expectation::Syntax("an object pattern"),
8882            Self::PatIgnore => parse::Expectation::Syntax("an ignore pattern"),
8883            Self::Path => parse::Expectation::Syntax("a path"),
8884            Self::PathGenerics => parse::Expectation::Syntax("the generics of a path"),
8885            Self::Condition => parse::Expectation::Syntax("the `let` condition of a loop"),
8886            Self::ClosureArguments => parse::Expectation::Syntax("closure arguments"),
8887            Self::AnonymousObjectKey => parse::Expectation::Syntax("an `#{` anonymous object key"),
8888            Self::Attribute => parse::Expectation::Syntax("an attribute"),
8889            Self::InnerAttribute => parse::Expectation::Syntax("an inner attribute"),
8890            Self::Modifiers => parse::Expectation::Syntax("modifiers"),
8891            Self::ModifierSuper => parse::Expectation::Syntax("the `(super)` modifier"),
8892            Self::ModifierSelf => parse::Expectation::Syntax("the `(self)` modifier"),
8893            Self::ModifierCrate => parse::Expectation::Syntax("the `(crate)` modifier"),
8894            Self::ModifierIn => parse::Expectation::Syntax("the `(in <path>)` modifier"),
8895            Self::TokenStream => parse::Expectation::Syntax("a raw token stream"),
8896            Self::TemplateString => parse::Expectation::Syntax("a raw token stream"),
8897        }
8898    }
8899}