|
1 |
| -abstract |
2 |
| -as |
3 |
| -asserts |
4 |
| -async |
5 |
| -await |
6 |
| -break |
7 |
| -case |
8 |
| -catch |
| 1 | +as; |
| 2 | +await; |
| 3 | +break; |
| 4 | +case; |
9 | 5 | class;
|
10 |
| -const |
11 |
| -constructor |
12 |
| -continue |
13 |
| -debugger |
14 |
| -declare |
15 |
| -default |
16 |
| -delete |
17 |
| -do |
18 |
| -else |
19 |
| -enum |
20 |
| -export |
| 6 | +const; |
| 7 | +continue; |
| 8 | +debugger; |
| 9 | +default; |
| 10 | +delete; |
| 11 | +do; |
| 12 | +else; |
| 13 | +enum; |
| 14 | +export; |
21 | 15 | extends;
|
22 |
| -finally |
23 |
| -for |
24 |
| -from |
25 |
| -function |
26 |
| -get |
27 |
| -if |
| 16 | +for; |
| 17 | +if; |
28 | 18 | implements;
|
29 |
| -import |
30 |
| -in |
| 19 | +import; |
| 20 | +in; |
31 | 21 | instanceof;
|
32 | 22 | interface;
|
33 |
| -is |
34 |
| -keyof |
35 |
| -let |
36 |
| -module |
37 |
| -namespace |
| 23 | +let; |
38 | 24 | new;
|
39 |
| -null |
40 |
| -of |
41 |
| -package |
42 |
| -private |
43 |
| -protected |
44 |
| -public |
45 |
| -readonly |
46 |
| -return |
47 |
| -require |
48 |
| -set |
49 |
| -static |
50 |
| -super |
51 |
| -switch |
52 |
| -this |
53 |
| -throw |
54 |
| -try |
55 |
| -type; |
56 |
| -typeof |
57 |
| -undefined |
58 |
| -var |
59 |
| -void |
60 |
| -while |
61 |
| -with |
62 |
| -yield |
| 25 | +null; |
| 26 | +of; |
| 27 | +package; |
| 28 | +private; |
| 29 | +protected; |
| 30 | +public; |
| 31 | +return; |
| 32 | +static; |
| 33 | +super; |
| 34 | +switch; |
| 35 | +this; |
| 36 | +throw; |
| 37 | +try; |
| 38 | +typeof; |
| 39 | +undefined; |
| 40 | +var; |
| 41 | +void; |
| 42 | +while; |
| 43 | +with; |
| 44 | +yield; |
| 45 | + |
| 46 | +// contextual keywords |
| 47 | + |
| 48 | +try {} catch {} finally {} |
| 49 | +try {} catch (e) {} finally {} |
| 50 | +async function (){} |
| 51 | +async a => {} |
| 52 | +async (a,b,c) => {} |
| 53 | +import {} from "foo" |
| 54 | +import {} from 'foo' |
| 55 | +class { get foo(){} set baz(){} get [value](){} } |
| 56 | + |
| 57 | +// variables, not keywords |
| 58 | + |
| 59 | +const { async, from, to } = bar; |
| 60 | +promise.catch(foo).finally(bar); |
| 61 | + |
| 62 | +// TypeScript keywords |
| 63 | + |
| 64 | +abstract; |
| 65 | +as; |
| 66 | +declare; |
| 67 | +implements; |
| 68 | +is; |
| 69 | +keyof; |
| 70 | +readonly; |
| 71 | +require; |
| 72 | + |
| 73 | +// contextual keywords |
| 74 | + |
| 75 | +asserts foo; |
| 76 | +infer foo; |
| 77 | +interface foo; |
| 78 | +module foo; |
| 79 | +namespace foo; |
| 80 | +type foo; |
| 81 | + |
| 82 | +import type { Component } from "react"; |
63 | 83 |
|
64 | 84 | ----------------------------------------------------
|
65 | 85 |
|
66 | 86 | [
|
67 |
| - ["keyword", "abstract"], |
68 |
| - ["keyword", "as"], |
69 |
| - ["keyword", "asserts"], |
70 |
| - ["keyword", "async"], |
71 |
| - ["keyword", "await"], |
72 |
| - ["keyword", "break"], |
73 |
| - ["keyword", "case"], |
74 |
| - ["keyword", "catch"], |
| 87 | + ["keyword", "as"], ["punctuation", ";"], |
| 88 | + ["keyword", "await"], ["punctuation", ";"], |
| 89 | + ["keyword", "break"], ["punctuation", ";"], |
| 90 | + ["keyword", "case"], ["punctuation", ";"], |
75 | 91 | ["keyword", "class"], ["punctuation", ";"],
|
76 |
| - ["keyword", "const"], |
77 |
| - ["keyword", "constructor"], |
78 |
| - ["keyword", "continue"], |
79 |
| - ["keyword", "debugger"], |
80 |
| - ["keyword", "declare"], |
81 |
| - ["keyword", "default"], |
82 |
| - ["keyword", "delete"], |
83 |
| - ["keyword", "do"], |
84 |
| - ["keyword", "else"], |
85 |
| - ["keyword", "enum"], |
86 |
| - ["keyword", "export"], |
| 92 | + ["keyword", "const"], ["punctuation", ";"], |
| 93 | + ["keyword", "continue"], ["punctuation", ";"], |
| 94 | + ["keyword", "debugger"], ["punctuation", ";"], |
| 95 | + ["keyword", "default"], ["punctuation", ";"], |
| 96 | + ["keyword", "delete"], ["punctuation", ";"], |
| 97 | + ["keyword", "do"], ["punctuation", ";"], |
| 98 | + ["keyword", "else"], ["punctuation", ";"], |
| 99 | + ["keyword", "enum"], ["punctuation", ";"], |
| 100 | + ["keyword", "export"], ["punctuation", ";"], |
87 | 101 | ["keyword", "extends"], ["punctuation", ";"],
|
88 |
| - ["keyword", "finally"], |
89 |
| - ["keyword", "for"], |
90 |
| - ["keyword", "from"], |
91 |
| - ["keyword", "function"], |
92 |
| - ["keyword", "get"], |
93 |
| - ["keyword", "if"], |
| 102 | + ["keyword", "for"], ["punctuation", ";"], |
| 103 | + ["keyword", "if"], ["punctuation", ";"], |
94 | 104 | ["keyword", "implements"], ["punctuation", ";"],
|
95 |
| - ["keyword", "import"], |
96 |
| - ["keyword", "in"], |
| 105 | + ["keyword", "import"], ["punctuation", ";"], |
| 106 | + ["keyword", "in"], ["punctuation", ";"], |
97 | 107 | ["keyword", "instanceof"], ["punctuation", ";"],
|
98 | 108 | ["keyword", "interface"], ["punctuation", ";"],
|
99 |
| - ["keyword", "is"], |
100 |
| - ["keyword", "keyof"], |
101 |
| - ["keyword", "let"], |
102 |
| - ["keyword", "module"], |
103 |
| - ["keyword", "namespace"], |
| 109 | + ["keyword", "let"], ["punctuation", ";"], |
104 | 110 | ["keyword", "new"], ["punctuation", ";"],
|
105 |
| - ["keyword", "null"], |
106 |
| - ["keyword", "of"], |
107 |
| - ["keyword", "package"], |
108 |
| - ["keyword", "private"], |
109 |
| - ["keyword", "protected"], |
110 |
| - ["keyword", "public"], |
111 |
| - ["keyword", "readonly"], |
112 |
| - ["keyword", "return"], |
113 |
| - ["keyword", "require"], |
114 |
| - ["keyword", "set"], |
115 |
| - ["keyword", "static"], |
116 |
| - ["keyword", "super"], |
117 |
| - ["keyword", "switch"], |
118 |
| - ["keyword", "this"], |
119 |
| - ["keyword", "throw"], |
| 111 | + ["keyword", "null"], ["punctuation", ";"], |
| 112 | + ["keyword", "of"], ["punctuation", ";"], |
| 113 | + ["keyword", "package"], ["punctuation", ";"], |
| 114 | + ["keyword", "private"], ["punctuation", ";"], |
| 115 | + ["keyword", "protected"], ["punctuation", ";"], |
| 116 | + ["keyword", "public"], ["punctuation", ";"], |
| 117 | + ["keyword", "return"], ["punctuation", ";"], |
| 118 | + ["keyword", "static"], ["punctuation", ";"], |
| 119 | + ["keyword", "super"], ["punctuation", ";"], |
| 120 | + ["keyword", "switch"], ["punctuation", ";"], |
| 121 | + ["keyword", "this"], ["punctuation", ";"], |
| 122 | + ["keyword", "throw"], ["punctuation", ";"], |
| 123 | + ["keyword", "try"], ["punctuation", ";"], |
| 124 | + ["keyword", "typeof"], ["punctuation", ";"], |
| 125 | + ["keyword", "undefined"], ["punctuation", ";"], |
| 126 | + ["keyword", "var"], ["punctuation", ";"], |
| 127 | + ["keyword", "void"], ["punctuation", ";"], |
| 128 | + ["keyword", "while"], ["punctuation", ";"], |
| 129 | + ["keyword", "with"], ["punctuation", ";"], |
| 130 | + ["keyword", "yield"], ["punctuation", ";"], |
| 131 | + |
| 132 | + ["comment", "// contextual keywords"], |
| 133 | + |
120 | 134 | ["keyword", "try"],
|
121 |
| - ["keyword", "type"], ["punctuation", ";"], |
122 |
| - ["keyword", "typeof"], |
123 |
| - ["keyword", "undefined"], |
124 |
| - ["keyword", "var"], |
125 |
| - ["keyword", "void"], |
126 |
| - ["keyword", "while"], |
127 |
| - ["keyword", "with"], |
128 |
| - ["keyword", "yield"] |
| 135 | + ["punctuation", "{"], |
| 136 | + ["punctuation", "}"], |
| 137 | + ["keyword", "catch"], |
| 138 | + ["punctuation", "{"], |
| 139 | + ["punctuation", "}"], |
| 140 | + ["keyword", "finally"], |
| 141 | + ["punctuation", "{"], |
| 142 | + ["punctuation", "}"], |
| 143 | + |
| 144 | + ["keyword", "try"], |
| 145 | + ["punctuation", "{"], |
| 146 | + ["punctuation", "}"], |
| 147 | + ["keyword", "catch"], |
| 148 | + ["punctuation", "("], |
| 149 | + "e", |
| 150 | + ["punctuation", ")"], |
| 151 | + ["punctuation", "{"], |
| 152 | + ["punctuation", "}"], |
| 153 | + ["keyword", "finally"], |
| 154 | + ["punctuation", "{"], |
| 155 | + ["punctuation", "}"], |
| 156 | + |
| 157 | + ["keyword", "async"], |
| 158 | + ["keyword", "function"], |
| 159 | + ["punctuation", "("], |
| 160 | + ["punctuation", ")"], |
| 161 | + ["punctuation", "{"], |
| 162 | + ["punctuation", "}"], |
| 163 | + |
| 164 | + ["keyword", "async"], |
| 165 | + " a ", |
| 166 | + ["operator", "=>"], |
| 167 | + ["punctuation", "{"], |
| 168 | + ["punctuation", "}"], |
| 169 | + |
| 170 | + ["keyword", "async"], |
| 171 | + ["punctuation", "("], |
| 172 | + "a", |
| 173 | + ["punctuation", ","], |
| 174 | + "b", |
| 175 | + ["punctuation", ","], |
| 176 | + "c", |
| 177 | + ["punctuation", ")"], |
| 178 | + ["operator", "=>"], |
| 179 | + ["punctuation", "{"], |
| 180 | + ["punctuation", "}"], |
| 181 | + |
| 182 | + ["keyword", "import"], |
| 183 | + ["punctuation", "{"], |
| 184 | + ["punctuation", "}"], |
| 185 | + ["keyword", "from"], |
| 186 | + ["string", "\"foo\""], |
| 187 | + |
| 188 | + ["keyword", "import"], |
| 189 | + ["punctuation", "{"], |
| 190 | + ["punctuation", "}"], |
| 191 | + ["keyword", "from"], |
| 192 | + ["string", "'foo'"], |
| 193 | + |
| 194 | + ["keyword", "class"], |
| 195 | + ["punctuation", "{"], |
| 196 | + ["keyword", "get"], |
| 197 | + ["function", "foo"], |
| 198 | + ["punctuation", "("], |
| 199 | + ["punctuation", ")"], |
| 200 | + ["punctuation", "{"], |
| 201 | + ["punctuation", "}"], |
| 202 | + ["keyword", "set"], |
| 203 | + ["function", "baz"], |
| 204 | + ["punctuation", "("], |
| 205 | + ["punctuation", ")"], |
| 206 | + ["punctuation", "{"], |
| 207 | + ["punctuation", "}"], |
| 208 | + ["keyword", "get"], |
| 209 | + ["punctuation", "["], |
| 210 | + "value", |
| 211 | + ["punctuation", "]"], |
| 212 | + ["punctuation", "("], |
| 213 | + ["punctuation", ")"], |
| 214 | + ["punctuation", "{"], |
| 215 | + ["punctuation", "}"], |
| 216 | + ["punctuation", "}"], |
| 217 | + |
| 218 | + ["comment", "// variables, not keywords"], |
| 219 | + |
| 220 | + ["keyword", "const"], |
| 221 | + ["punctuation", "{"], |
| 222 | + " async", |
| 223 | + ["punctuation", ","], |
| 224 | + " from", |
| 225 | + ["punctuation", ","], |
| 226 | + " to ", |
| 227 | + ["punctuation", "}"], |
| 228 | + ["operator", "="], |
| 229 | + " bar", |
| 230 | + ["punctuation", ";"], |
| 231 | + |
| 232 | + "\r\npromise", |
| 233 | + ["punctuation", "."], |
| 234 | + ["function", "catch"], |
| 235 | + ["punctuation", "("], |
| 236 | + "foo", |
| 237 | + ["punctuation", ")"], |
| 238 | + ["punctuation", "."], |
| 239 | + ["function", "finally"], |
| 240 | + ["punctuation", "("], |
| 241 | + "bar", |
| 242 | + ["punctuation", ")"], |
| 243 | + ["punctuation", ";"], |
| 244 | + |
| 245 | + ["comment", "// TypeScript keywords"], |
| 246 | + |
| 247 | + ["keyword", "abstract"], ["punctuation", ";"], |
| 248 | + ["keyword", "as"], ["punctuation", ";"], |
| 249 | + ["keyword", "declare"], ["punctuation", ";"], |
| 250 | + ["keyword", "implements"], ["punctuation", ";"], |
| 251 | + ["keyword", "is"], ["punctuation", ";"], |
| 252 | + ["keyword", "keyof"], ["punctuation", ";"], |
| 253 | + ["keyword", "readonly"], ["punctuation", ";"], |
| 254 | + ["keyword", "require"], ["punctuation", ";"], |
| 255 | + |
| 256 | + ["comment", "// contextual keywords"], |
| 257 | + |
| 258 | + ["keyword", "asserts"], " foo", ["punctuation", ";"], |
| 259 | + ["keyword", "infer"], " foo", ["punctuation", ";"], |
| 260 | + ["keyword", "interface"], ["class-name", ["foo"]], ["punctuation", ";"], |
| 261 | + ["keyword", "module"], " foo", ["punctuation", ";"], |
| 262 | + ["keyword", "namespace"], " foo", ["punctuation", ";"], |
| 263 | + ["keyword", "type"], ["class-name", ["foo"]], ["punctuation", ";"], |
| 264 | + |
| 265 | + ["keyword", "import"], |
| 266 | + ["keyword", "type"], |
| 267 | + ["punctuation", "{"], |
| 268 | + " Component ", |
| 269 | + ["punctuation", "}"], |
| 270 | + ["keyword", "from"], |
| 271 | + ["string", "\"react\""], |
| 272 | + ["punctuation", ";"] |
129 | 273 | ]
|
130 | 274 |
|
131 | 275 | ----------------------------------------------------
|
|
0 commit comments