Debian Codegraph @

src/briefcase/constants.py

raw
1 # Javascript reserved keywords:
2 # https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#reserved_keywords_as_of_ecmascript_2015
3 JAVASCRIPT_RESERVED_WORDS = {
4 "break",
5 "case",
6 "catch",
7 "class",
8 "const",
9 "continue",
10 "debugger",
11 "default",
12 "delete",
13 "do",
14 "else",
15 "export",
16 "extends",
17 "finally",
18 "for",
19 "function",
20 "if",
21 "import",
22 "in",
23 "instanceof",
24 "new",
25 "return",
26 "super",
27 "switch",
28 "this",
29 "throw",
30 "try",
31 "typeof",
32 "var",
33 "void",
34 "while",
35 "with",
36 "yield",
37 }
38
39 # Java reserved keywords
40 # https://en.wikipedia.org/wiki/List_of_Java_keywords
41 JAVA_RESERVED_WORDS = {
42 # Keywords
43 "abstract",
44 "assert",
45 "boolean",
46 "break",
47 "byte",
48 "case",
49 "catch",
50 "char",
51 "class",
52 "const",
53 "continue",
54 "default",
55 "do",
56 "double",
57 "else",
58 "enum",
59 "extends",
60 "final",
61 "finally",
62 "float",
63 "for",
64 "goto",
65 "if",
66 "implements",
67 "import",
68 "instanceof",
69 "int",
70 "interface",
71 "long",
72 "native",
73 "new",
74 "package",
75 "private",
76 "protected",
77 "public",
78 "return",
79 "short",
80 "static",
81 "super",
82 "switch",
83 "synchronized",
84 "this",
85 "throw",
86 "throws",
87 "transient",
88 "try",
89 "void",
90 "volatile",
91 "while",
92 # Reserved Identifiers
93 "exports",
94 "module",
95 "non-sealed",
96 "open",
97 "opens",
98 "permits",
99 "provides",
100 "record",
101 "requires",
102 "sealed",
103 "to",
104 "transitive",
105 "uses",
106 "var",
107 "with",
108 "yield",
109 # Reserved Literals
110 "true",
111 "false",
112 "null",
113 # Unused, but reserved.
114 "strictfp",
115 }
116
117
118 # Names that are illegal as Windows filenames
119 # https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
120 WINDOWS_RESERVED_WORDS = {
121 "con",
122 "prn",
123 "aux",
124 "nul",
125 "com1",
126 "com2",
127 "com3",
128 "com4",
129 "com5",
130 "com6",
131 "com7",
132 "com8",
133 "com9",
134 "com0",
135 "lpt1",
136 "lpt2",
137 "lpt3",
138 "lpt4",
139 "lpt5",
140 "lpt6",
141 "lpt7",
142 "lpt8",
143 "lpt9",
144 "lpt0",
145 }
146
147 NON_PYTHON_RESERVED_WORDS = set.union(
148 JAVASCRIPT_RESERVED_WORDS,
149 JAVA_RESERVED_WORDS,
150 WINDOWS_RESERVED_WORDS,
151 )
152
153 # All standard library names for python 3.8 through 3.11,
154 # plus 'main' which is reserved for briefcase use.
155 PYTHON_RESERVED_WORDS = {
156 "_ast",
157 "_dummy_thread",
158 "_thread",
159 "abc",
160 "aifc",
161 "argparse",
162 "array",
163 "ast",
164 "asynchat",
165 "asyncio",
166 "asyncore",
167 "atexit",
168 "audioop",
169 "base64",
170 "bdb",
171 "binascii",
172 "binhex",
173 "bisect",
174 "builtins",
175 "bz2",
176 "cProfile",
177 "calendar",
178 "cgi",
179 "cgitb",
180 "chunk",
181 "cmath",
182 "cmd",
183 "code",
184 "codecs",
185 "codeop",
186 "collections",
187 "colorsys",
188 "compileall",
189 "concurrent",
190 "configparser",
191 "contextlib",
192 "contextvars",
193 "copy",
194 "copyreg",
195 "crypt",
196 "csv",
197 "ctypes",
198 "curses",
199 "dataclasses",
200 "datetime",
201 "dbm",
202 "decimal",
203 "difflib",
204 "dis",
205 "distutils",
206 "doctest",
207 "dummy_threading",
208 "email",
209 "encodings",
210 "ensurepip",
211 "enum",
212 "errno",
213 "faulthandler",
214 "fcntl",
215 "filecmp",
216 "fileinput",
217 "fnmatch",
218 "formatter",
219 "fractions",
220 "ftplib",
221 "functools",
222 "gc",
223 "getopt",
224 "getpass",
225 "gettext",
226 "glob",
227 "graphlib",
228 "grp",
229 "gzip",
230 "hashlib",
231 "heapq",
232 "hmac",
233 "html",
234 "http",
235 "idlelib",
236 "imaplib",
237 "imghdr",
238 "imp",
239 "importlib",
240 "inspect",
241 "io",
242 "ipaddress",
243 "itertools",
244 "json",
245 "keyword",
246 "lib2to3",
247 "linecache",
248 "locale",
249 "logging",
250 "lzma",
251 "mailbox",
252 "mailcap",
253 "main",
254 "marshal",
255 "math",
256 "mimetypes",
257 "mmap",
258 "modulefinder",
259 "msilib",
260 "msvcrt",
261 "multiprocessing",
262 "netrc",
263 "nis",
264 "nntplib",
265 "ntpath",
266 "numbers",
267 "operator",
268 "optparse",
269 "os",
270 "ossaudiodev",
271 "parser",
272 "pathlib",
273 "pdb",
274 "pickle",
275 "pickletools",
276 "pipes",
277 "pkgutil",
278 "platform",
279 "plistlib",
280 "poplib",
281 "posix",
282 "posixpath",
283 "pprint",
284 "profile",
285 "pstats",
286 "pty",
287 "pwd",
288 "py_compile",
289 "pyclbr",
290 "pydoc",
291 "queue",
292 "quopri",
293 "random",
294 "re",
295 "readline",
296 "reprlib",
297 "resource",
298 "rlcompleter",
299 "runpy",
300 "sched",
301 "secrets",
302 "select",
303 "selectors",
304 "shelve",
305 "shlex",
306 "shutil",
307 "signal",
308 "site",
309 "smtpd",
310 "smtplib",
311 "sndhdr",
312 "socket",
313 "socketserver",
314 "spwd",
315 "sqlite3",
316 "sre",
317 "sre_compile",
318 "sre_constants",
319 "sre_parse",
320 "ssl",
321 "stat",
322 "statistics",
323 "string",
324 "stringprep",
325 "struct",
326 "subprocess",
327 "sunau",
328 "symbol",
329 "symtable",
330 "sys",
331 "sysconfig",
332 "syslog",
333 "tabnanny",
334 "tarfile",
335 "telnetlib",
336 "tempfile",
337 "termios",
338 "test",
339 "textwrap",
340 "threading",
341 "time",
342 "timeit",
343 "tkinter",
344 "token",
345 "tokenize",
346 "tomllib",
347 "trace",
348 "traceback",
349 "tracemalloc",
350 "tty",
351 "turtle",
352 "turtledemo",
353 "types",
354 "typing",
355 "unicodedata",
356 "unittest",
357 "urllib",
358 "uu",
359 "uuid",
360 "venv",
361 "warnings",
362 "wave",
363 "weakref",
364 "webbrowser",
365 "winreg",
366 "winsound",
367 "wsgiref",
368 "xdrlib",
369 "xml",
370 "xmlrpc",
371 "zipapp",
372 "zipfile",
373 "zipimport",
374 "zlib",
375 "zoneinfo",
376 }
377
378 RESERVED_WORDS = set.union(
379 PYTHON_RESERVED_WORDS,
380 NON_PYTHON_RESERVED_WORDS,
381 )