1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/// An enum of all possible tokens allowed by the
/// [WebIDL grammar](https://heycam.github.io/webidl/#idl-grammar) A token in this case is a
/// terminal, either a static string or regular expression based token. Note that not all possible
/// simplifications are made such as converting the `True` and `False` tokens to actual booleans.
/// This choice was made to be as consistent as possible with the WebIDL grammar.
#[allow(missing_docs)]
#[derive(Clone, Debug, PartialEq)]
pub enum Token {
    // Keywords
    Any,
    ArrayBuffer,
    Attribute,
    Boolean,
    Byte,
    ByteString,
    Callback,
    Const,
    DataView,
    Deleter,
    Dictionary,
    DOMException,
    DOMString,
    Double,
    Enum,
    Error,
    False,
    Float,
    Float32Array,
    Float64Array,
    FrozenArray,
    Getter,
    Implements,
    Inherit,
    Int16Array,
    Int32Array,
    Int8Array,
    Interface,
    Iterable,
    LegacyCaller,
    Long,
    Maplike,
    Namespace,
    NaN,
    NegativeInfinity,
    Null,
    Object,
    Octet,
    Optional,
    Or,
    Partial,
    PositiveInfinity,
    Promise,
    ReadOnly,
    Record,
    Required,
    Sequence,
    Serializer,
    Setlike,
    Setter,
    Short,
    Static,
    Stringifier,
    True,
    Typedef,
    USVString,
    Uint16Array,
    Uint32Array,
    Uint8Array,
    Uint8ClampedArray,
    Unrestricted,
    Unsigned,
    Void,

    // Regular expressions
    FloatLiteral(f64),
    Identifier(String),
    IntegerLiteral(i64),
    OtherLiteral(char),
    StringLiteral(String),

    // Symbols
    Colon,
    Comma,
    Ellipsis,
    Equals,
    GreaterThan,
    Hyphen,
    LeftBrace,
    LeftBracket,
    LeftParenthesis,
    LessThan,
    Period,
    QuestionMark,
    RightBrace,
    RightBracket,
    RightParenthesis,
    Semicolon,
}