UNPKG

3.94 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.GO_RESERVED = exports.PYTHON_RESERVED = exports.JAVA_RESERVED = exports.CSHARP_RESERVED = exports.isReservedName = void 0;
4function isReservedName(name) {
5 const reserved = new Array();
6 if (exports.CSHARP_RESERVED.has(name)) {
7 reserved.push('C#');
8 }
9 if (exports.JAVA_RESERVED.has(name)) {
10 reserved.push('Java');
11 }
12 if (exports.PYTHON_RESERVED.has(name)) {
13 reserved.push('Python');
14 }
15 if (exports.GO_RESERVED.has(name)) {
16 reserved.push('Go');
17 }
18 return reserved.length > 0 ? reserved : undefined;
19}
20exports.isReservedName = isReservedName;
21exports.CSHARP_RESERVED = new Set([
22 'abstract',
23 'as',
24 'base',
25 'bool',
26 'break',
27 'byte',
28 'case',
29 'catch',
30 'char',
31 'checked',
32 'class',
33 'const',
34 'continue',
35 'decimal',
36 'default',
37 'delegate',
38 'do',
39 'double',
40 'else',
41 'enum',
42 'event',
43 'explicit',
44 'extern',
45 'false',
46 'finally',
47 'fixed',
48 'float',
49 'for',
50 'foreach',
51 'goto',
52 'if',
53 'implicit',
54 'in',
55 'int',
56 'interface',
57 'internal',
58 'is',
59 'lock',
60 'long',
61 'namespace',
62 'new',
63 'null',
64 'object',
65 'operator',
66 'out',
67 'override',
68 'params',
69 'private',
70 'protected',
71 'public',
72 'readonly',
73 'ref',
74 'return',
75 'sbyte',
76 'sealed',
77 'short',
78 'sizeof',
79 'stackalloc',
80 'static',
81 'string',
82 'struct',
83 'switch',
84 'this',
85 'throw',
86 'true',
87 'try',
88 'typeof',
89 'uint',
90 'ulong',
91 'unchecked',
92 'unsafe',
93 'ushort',
94 'using',
95 'virtual',
96 'void',
97 'volatile',
98 'while',
99]);
100exports.JAVA_RESERVED = new Set([
101 'abstract',
102 'continue',
103 'for',
104 'new',
105 'switch',
106 'assert',
107 'default',
108 'goto',
109 'package',
110 'synchronized',
111 'boolean',
112 'do',
113 'if',
114 'private',
115 'this',
116 'break',
117 'double',
118 'implements',
119 'protected',
120 'throw',
121 'byte',
122 'else',
123 'import',
124 'public',
125 'throws',
126 'case',
127 'enum',
128 'instanceof',
129 'return',
130 'transient',
131 'catch',
132 'extends',
133 'int',
134 'short',
135 'try',
136 'char',
137 'final',
138 'interface',
139 'static',
140 'void',
141 'class',
142 'finally',
143 'long',
144 'strictfp',
145 'volatile',
146 'const',
147 'float',
148 'native',
149 'super',
150 'while',
151 'true',
152 'false',
153 'null',
154]);
155exports.PYTHON_RESERVED = new Set([
156 'False',
157 'class',
158 'finally',
159 'is',
160 'return',
161 'None',
162 'continue',
163 'for',
164 'lambda',
165 'try',
166 'True',
167 'def',
168 'from',
169 'nonlocal',
170 'while',
171 'and',
172 'del',
173 'global',
174 'not',
175 'with',
176 'as',
177 'elif',
178 'if',
179 'or',
180 'yield',
181 'assert',
182 'else',
183 'import',
184 'pass',
185 'break',
186 'except',
187 'in',
188 'raise',
189 'self',
190]);
191exports.GO_RESERVED = new Set([
192 'break',
193 'case',
194 'chan',
195 'const',
196 'continue',
197 'default',
198 'defer',
199 'else',
200 'fallthrough',
201 'for',
202 'func',
203 'go',
204 'goto',
205 'if',
206 'import',
207 'interface',
208 'map',
209 'package',
210 'range',
211 'return',
212 'select',
213 'struct',
214 'switch',
215 'type',
216 'var',
217 // constants
218 'true',
219 'false',
220 'iota',
221 'nil',
222 // types
223 'int',
224 'int8',
225 'int16',
226 'int32',
227 'int64',
228 'uint',
229 'uint8',
230 'uint16',
231 'uint32',
232 'uint64',
233 'uintptr',
234 'float32',
235 'float64',
236 'complex128',
237 'complex64',
238 'bool',
239 'rune',
240 'byte',
241 'string',
242 'error',
243 // functions
244 'make',
245 'len',
246 'cap',
247 'new',
248 'append',
249 'copy',
250 'close',
251 'delete',
252 'complex',
253 'real',
254 'imag',
255 'panic',
256 'recover',
257]);
258//# sourceMappingURL=reserved-words.js.map
\No newline at end of file