rune_macros/quote/
generated.rs

1use crate::quote;
2
3// This file has been generated from `assets/tokens.yaml`
4// DO NOT modify by hand!
5
6pub(crate) fn kind_from_ident(ident: &str) -> Option<quote::Kind> {
7    match ident {
8        "abstract" => Some(quote::Kind("Abstract")),
9        "alignof" => Some(quote::Kind("AlignOf")),
10        "as" => Some(quote::Kind("As")),
11        "async" => Some(quote::Kind("Async")),
12        "await" => Some(quote::Kind("Await")),
13        "become" => Some(quote::Kind("Become")),
14        "break" => Some(quote::Kind("Break")),
15        "const" => Some(quote::Kind("Const")),
16        "continue" => Some(quote::Kind("Continue")),
17        "crate" => Some(quote::Kind("Crate")),
18        "default" => Some(quote::Kind("Default")),
19        "do" => Some(quote::Kind("Do")),
20        "else" => Some(quote::Kind("Else")),
21        "enum" => Some(quote::Kind("Enum")),
22        "extern" => Some(quote::Kind("Extern")),
23        "false" => Some(quote::Kind("False")),
24        "final" => Some(quote::Kind("Final")),
25        "fn" => Some(quote::Kind("Fn")),
26        "for" => Some(quote::Kind("For")),
27        "if" => Some(quote::Kind("If")),
28        "impl" => Some(quote::Kind("Impl")),
29        "in" => Some(quote::Kind("In")),
30        "is" => Some(quote::Kind("Is")),
31        "let" => Some(quote::Kind("Let")),
32        "loop" => Some(quote::Kind("Loop")),
33        "macro" => Some(quote::Kind("Macro")),
34        "match" => Some(quote::Kind("Match")),
35        "mod" => Some(quote::Kind("Mod")),
36        "move" => Some(quote::Kind("Move")),
37        "mut" => Some(quote::Kind("Mut")),
38        "not" => Some(quote::Kind("Not")),
39        "offsetof" => Some(quote::Kind("OffsetOf")),
40        "override" => Some(quote::Kind("Override")),
41        "priv" => Some(quote::Kind("Priv")),
42        "proc" => Some(quote::Kind("Proc")),
43        "pub" => Some(quote::Kind("Pub")),
44        "pure" => Some(quote::Kind("Pure")),
45        "ref" => Some(quote::Kind("Ref")),
46        "return" => Some(quote::Kind("Return")),
47        "select" => Some(quote::Kind("Select")),
48        "Self" => Some(quote::Kind("SelfType")),
49        "self" => Some(quote::Kind("SelfValue")),
50        "sizeof" => Some(quote::Kind("SizeOf")),
51        "static" => Some(quote::Kind("Static")),
52        "struct" => Some(quote::Kind("Struct")),
53        "super" => Some(quote::Kind("Super")),
54        "true" => Some(quote::Kind("True")),
55        "typeof" => Some(quote::Kind("TypeOf")),
56        "unsafe" => Some(quote::Kind("Unsafe")),
57        "use" => Some(quote::Kind("Use")),
58        "virtual" => Some(quote::Kind("Virtual")),
59        "while" => Some(quote::Kind("While")),
60        "yield" => Some(quote::Kind("Yield")),
61        _ => None,
62    }
63}
64
65pub(crate) fn kind_from_punct(buf: &[char]) -> Option<quote::Kind> {
66    match buf {
67        ['&', '\0', '\0'] => Some(quote::Kind("Amp")),
68        ['&', '&', '\0'] => Some(quote::Kind("AmpAmp")),
69        ['&', '=', '\0'] => Some(quote::Kind("AmpEq")),
70        ['-', '>', '\0'] => Some(quote::Kind("Arrow")),
71        ['@', '\0', '\0'] => Some(quote::Kind("At")),
72        ['!', '\0', '\0'] => Some(quote::Kind("Bang")),
73        ['!', '=', '\0'] => Some(quote::Kind("BangEq")),
74        ['^', '\0', '\0'] => Some(quote::Kind("Caret")),
75        ['^', '=', '\0'] => Some(quote::Kind("CaretEq")),
76        [':', '\0', '\0'] => Some(quote::Kind("Colon")),
77        [':', ':', '\0'] => Some(quote::Kind("ColonColon")),
78        [',', '\0', '\0'] => Some(quote::Kind("Comma")),
79        ['-', '\0', '\0'] => Some(quote::Kind("Dash")),
80        ['-', '=', '\0'] => Some(quote::Kind("DashEq")),
81        ['/', '\0', '\0'] => Some(quote::Kind("Div")),
82        ['$', '\0', '\0'] => Some(quote::Kind("Dollar")),
83        ['.', '\0', '\0'] => Some(quote::Kind("Dot")),
84        ['.', '.', '\0'] => Some(quote::Kind("DotDot")),
85        ['.', '.', '='] => Some(quote::Kind("DotDotEq")),
86        ['=', '\0', '\0'] => Some(quote::Kind("Eq")),
87        ['=', '=', '\0'] => Some(quote::Kind("EqEq")),
88        ['>', '\0', '\0'] => Some(quote::Kind("Gt")),
89        ['>', '=', '\0'] => Some(quote::Kind("GtEq")),
90        ['>', '>', '\0'] => Some(quote::Kind("GtGt")),
91        ['>', '>', '='] => Some(quote::Kind("GtGtEq")),
92        ['<', '\0', '\0'] => Some(quote::Kind("Lt")),
93        ['<', '=', '\0'] => Some(quote::Kind("LtEq")),
94        ['<', '<', '\0'] => Some(quote::Kind("LtLt")),
95        ['<', '<', '='] => Some(quote::Kind("LtLtEq")),
96        ['%', '\0', '\0'] => Some(quote::Kind("Perc")),
97        ['%', '=', '\0'] => Some(quote::Kind("PercEq")),
98        ['|', '\0', '\0'] => Some(quote::Kind("Pipe")),
99        ['|', '=', '\0'] => Some(quote::Kind("PipeEq")),
100        ['|', '|', '\0'] => Some(quote::Kind("PipePipe")),
101        ['+', '\0', '\0'] => Some(quote::Kind("Plus")),
102        ['+', '=', '\0'] => Some(quote::Kind("PlusEq")),
103        ['#', '\0', '\0'] => Some(quote::Kind("Pound")),
104        ['?', '\0', '\0'] => Some(quote::Kind("QuestionMark")),
105        ['=', '>', '\0'] => Some(quote::Kind("Rocket")),
106        [';', '\0', '\0'] => Some(quote::Kind("SemiColon")),
107        ['/', '=', '\0'] => Some(quote::Kind("SlashEq")),
108        ['*', '\0', '\0'] => Some(quote::Kind("Star")),
109        ['*', '=', '\0'] => Some(quote::Kind("StarEq")),
110        ['~', '\0', '\0'] => Some(quote::Kind("Tilde")),
111        ['_', '\0', '\0'] => Some(quote::Kind("Underscore")),
112        _ => None,
113    }
114}