blob: 6470cb95091e40f3b8c4938641a08e4cb5dda487 [file] [log] [blame]
Damien George04b91472014-05-03 23:27:38 +01001/*
2 * This file is part of the Micro Python project, http://micropython.org/
3 *
4 * The MIT License (MIT)
5 *
6 * Copyright (c) 2013, 2014 Damien P. George
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files (the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 * THE SOFTWARE.
25 */
26
Paul Sokolovskya925cb52014-04-11 20:50:15 +030027#include "mpconfig.h"
Damien Georgeeb7bfcb2014-01-04 15:57:35 +000028// All the qstr definitions in this file are available as constants.
Damien George0c36da02014-03-08 15:24:39 +000029// That is, they are in ROM and you can reference them simply as MP_QSTR_xxxx.
Damien Georgeeb7bfcb2014-01-04 15:57:35 +000030
Damien George708c0732014-04-27 19:23:46 +010031Q(*)
Damien Georgeeb7bfcb2014-01-04 15:57:35 +000032Q(__build_class__)
33Q(__class__)
34Q(__doc__)
Paul Sokolovsky1d938c92014-02-04 00:46:17 +020035Q(__import__)
Damien Georgeeb7bfcb2014-01-04 15:57:35 +000036Q(__init__)
Paul Sokolovsky13684fd2014-05-18 20:37:18 +030037Q(__new__)
Damien Georgeeb7bfcb2014-01-04 15:57:35 +000038Q(__locals__)
39Q(__main__)
40Q(__module__)
41Q(__name__)
42Q(__next__)
43Q(__qualname__)
Paul Sokolovsky13d52df2014-04-11 23:25:35 +030044Q(__path__)
Damien Georgeeb7bfcb2014-01-04 15:57:35 +000045Q(__repl_print__)
Paul Sokolovskyd0f5e612014-07-25 11:00:15 +030046#if MICROPY_PY___FILE__
47Q(__file__)
48#endif
Damien Georgeeb7bfcb2014-01-04 15:57:35 +000049
Damien George09a0c642014-01-30 10:05:33 +000050Q(__bool__)
Paul Sokolovsky036ad762014-04-13 10:39:25 +030051Q(__contains__)
Paul Sokolovsky44307d52014-03-29 04:10:11 +020052Q(__enter__)
53Q(__exit__)
Damien George09a0c642014-01-30 10:05:33 +000054Q(__len__)
Damien George9e6e9352014-03-26 18:37:06 +000055Q(__iter__)
Damien George7c9c6672014-01-25 00:17:36 +000056Q(__getitem__)
Damien George7d0bfbe2014-02-08 19:01:47 +000057Q(__setitem__)
Paul Sokolovsky14de1142014-04-13 23:55:59 +030058Q(__delitem__)
Damien George7c9c6672014-01-25 00:17:36 +000059Q(__add__)
60Q(__sub__)
Paul Sokolovsky51bbf6a2014-03-16 15:16:54 +020061Q(__repr__)
62Q(__str__)
Damien Georgee44d26a2014-03-31 22:57:56 +010063Q(__getattr__)
muxcc849f72014-04-05 15:49:03 +020064Q(__del__)
Paul Sokolovsky755565d2014-04-25 21:15:16 +030065Q(__call__)
Paul Sokolovsky5473f742014-06-08 00:01:46 +030066Q(__lt__)
Damien George7c9c6672014-01-25 00:17:36 +000067
Damien Georgeeb7bfcb2014-01-04 15:57:35 +000068Q(micropython)
Damien George3417bc22014-05-10 10:36:38 +010069Q(bytecode)
Damien Georgeeb7bfcb2014-01-04 15:57:35 +000070Q(native)
71Q(viper)
Damien Georgeffae48d2014-05-08 15:58:39 +000072Q(const)
Damien Georgee5f8a772014-04-21 13:33:15 +010073
74#if MICROPY_EMIT_INLINE_THUMB
Damien Georgeeb7bfcb2014-01-04 15:57:35 +000075Q(asm_thumb)
Damien Georgee5f8a772014-04-21 13:33:15 +010076Q(label)
77Q(align)
78Q(data)
79#endif
Damien Georgeeb7bfcb2014-01-04 15:57:35 +000080
Damien Georgee9906ac2014-01-04 18:44:46 +000081Q(Ellipsis)
Damien Georgeeb7bfcb2014-01-04 15:57:35 +000082Q(StopIteration)
83
Damien Georgec5966122014-02-15 16:10:44 +000084Q(BaseException)
Rachel Dowdall721c55d2014-03-22 15:28:16 +000085Q(ArithmeticError)
Damien George71c51812014-01-04 20:21:15 +000086Q(AssertionError)
Damien Georgeeb7bfcb2014-01-04 15:57:35 +000087Q(AttributeError)
Rachel Dowdall721c55d2014-03-22 15:28:16 +000088Q(BufferError)
Rachel Dowdall721c55d2014-03-22 15:28:16 +000089Q(EOFError)
Rachel Dowdall721c55d2014-03-22 15:28:16 +000090Q(Exception)
91Q(FileExistsError)
92Q(FileNotFoundError)
93Q(FloatingPointError)
Rachel Dowdall721c55d2014-03-22 15:28:16 +000094Q(GeneratorExit)
95Q(IOError)
Paul Sokolovsky7cd54d72014-02-04 03:33:55 +020096Q(ImportError)
Damien George9528cd62014-01-15 21:23:31 +000097Q(IndentationError)
Damien Georgeeb7bfcb2014-01-04 15:57:35 +000098Q(IndexError)
99Q(KeyError)
Rachel Dowdall721c55d2014-03-22 15:28:16 +0000100Q(LookupError)
101Q(MemoryError)
Damien Georgeeb7bfcb2014-01-04 15:57:35 +0000102Q(NameError)
Paul Sokolovsky76f06de2014-02-09 13:17:36 +0200103Q(NotImplementedError)
Damien George9528cd62014-01-15 21:23:31 +0000104Q(OSError)
Paul Sokolovsky166bb402014-01-18 12:46:43 +0200105Q(OverflowError)
Rachel Dowdall721c55d2014-03-22 15:28:16 +0000106Q(RuntimeError)
Rachel Dowdall721c55d2014-03-22 15:28:16 +0000107Q(SyntaxError)
Rachel Dowdall721c55d2014-03-22 15:28:16 +0000108Q(SystemError)
Damien George7a4ddd22014-05-24 23:32:19 +0100109Q(SystemExit)
Rachel Dowdall721c55d2014-03-22 15:28:16 +0000110Q(TypeError)
111Q(UnboundLocalError)
Rachel Dowdall721c55d2014-03-22 15:28:16 +0000112Q(ValueError)
Rachel Dowdall300c8bd2014-03-20 22:40:38 +0000113Q(ZeroDivisionError)
Damien Georgeeb7bfcb2014-01-04 15:57:35 +0000114
Damien George3ec0a1a2014-03-22 21:31:28 +0000115Q(None)
116Q(False)
117Q(True)
118Q(object)
Rachel Dowdall721c55d2014-03-22 15:28:16 +0000119
Damien Georgea71c83a2014-02-15 11:34:50 +0000120Q(NoneType)
121
Damien Georgeeb7bfcb2014-01-04 15:57:35 +0000122Q(abs)
123Q(all)
124Q(any)
Paul Sokolovsky9512e9e2014-03-25 01:29:09 +0200125Q(args)
Paul Sokolovsky427905c2014-01-18 19:24:47 +0200126Q(array)
Damien George897fe0c2014-04-15 22:03:55 +0100127Q(bin)
128Q({:#b})
Damien Georgeeb7bfcb2014-01-04 15:57:35 +0000129Q(bool)
Paul Sokolovsky427905c2014-01-18 19:24:47 +0200130Q(bytearray)
Paul Sokolovskya80ff042014-01-20 20:32:50 +0200131Q(bytes)
Damien Georgeeb7bfcb2014-01-04 15:57:35 +0000132Q(callable)
Damien Georgeee3fd462014-05-24 23:03:12 +0100133#if MICROPY_PY_STRUCT
Paul Sokolovskye9db8402014-04-10 03:45:38 +0300134Q(calcsize)
135#endif
Damien Georgeeb7bfcb2014-01-04 15:57:35 +0000136Q(chr)
Damien George64131f32014-02-06 20:31:44 +0000137Q(classmethod)
Paul Sokolovsky48fdaad2014-04-13 10:17:04 +0300138Q(_collections)
Damien Georgeeb7bfcb2014-01-04 15:57:35 +0000139Q(complex)
140Q(dict)
Damien George4acb2452014-02-02 22:07:44 +0000141Q(dir)
Damien Georgeeb7bfcb2014-01-04 15:57:35 +0000142Q(divmod)
John R. Lenton9daa7892014-01-14 23:55:01 +0000143Q(enumerate)
Damien Georged02c6d82014-01-15 22:14:03 +0000144Q(eval)
Damien Georgeca476792014-02-03 22:44:10 +0000145Q(exec)
John R. Lentonfca456b2014-01-15 01:37:08 +0000146Q(filter)
Damien Georgeeb7bfcb2014-01-04 15:57:35 +0000147Q(float)
Paul Sokolovskya985b452014-04-09 00:40:58 +0300148Q(from_bytes)
Paul Sokolovskye9137b92014-03-26 23:35:13 +0200149Q(getattr)
Paul Sokolovskycc0af3d2014-04-06 01:00:46 +0300150Q(globals)
Paul Sokolovskyff306662014-05-11 19:05:42 +0300151Q(hasattr)
Damien Georgeeb7bfcb2014-01-04 15:57:35 +0000152Q(hash)
Damien George58051112014-04-15 12:42:52 +0100153Q(hex)
Damien Georgeb013aea2014-04-15 12:50:21 +0100154Q(%#x)
xbe0ebf8532014-02-01 19:00:41 -0800155Q(id)
Damien Georgeeb7bfcb2014-01-04 15:57:35 +0000156Q(int)
Damien George004cdce2014-01-09 21:43:51 +0000157Q(isinstance)
158Q(issubclass)
Damien Georgeeb7bfcb2014-01-04 15:57:35 +0000159Q(iter)
160Q(len)
161Q(list)
Paul Sokolovskycc0af3d2014-04-06 01:00:46 +0300162Q(locals)
John R. Lenton39b174e2014-01-15 01:10:09 +0000163Q(map)
Damien Georgeeb7bfcb2014-01-04 15:57:35 +0000164Q(max)
165Q(min)
Paul Sokolovskyd08fd682014-02-27 22:22:04 +0200166Q(namedtuple)
Damien Georgeeb7bfcb2014-01-04 15:57:35 +0000167Q(next)
Damien George897fe0c2014-04-15 22:03:55 +0100168Q(oct)
169Q(%#o)
Damien George27e735f2014-04-05 23:02:23 +0100170Q(open)
Damien Georgeeb7bfcb2014-01-04 15:57:35 +0000171Q(ord)
Paul Sokolovskye11b17c2014-02-05 00:47:06 +0200172Q(path)
Damien Georgeeb7bfcb2014-01-04 15:57:35 +0000173Q(pow)
174Q(print)
175Q(range)
Paul Sokolovsky27f5bdd2014-04-26 21:15:56 +0300176Q(read)
Damien Georgee2fb2ba2014-01-15 21:40:48 +0000177Q(repr)
Damien Georgeeb7bfcb2014-01-04 15:57:35 +0000178Q(set)
John R. Lenton5c768392014-01-13 05:12:50 +0000179Q(sorted)
Damien George64131f32014-02-06 20:31:44 +0000180Q(staticmethod)
Damien Georgeeb7bfcb2014-01-04 15:57:35 +0000181Q(sum)
Damien George35e2a4e2014-02-05 00:51:47 +0000182Q(super)
Paul Sokolovsky36c44992014-01-13 19:20:46 +0200183Q(str)
Paul Sokolovsky0c59db12014-02-04 07:55:10 +0200184Q(sys)
Paul Sokolovskya985b452014-04-09 00:40:58 +0300185Q(to_bytes)
Damien George71c51812014-01-04 20:21:15 +0000186Q(tuple)
Damien Georgeeb7bfcb2014-01-04 15:57:35 +0000187Q(type)
Paul Sokolovsky9512e9e2014-03-25 01:29:09 +0200188Q(value)
Paul Sokolovsky27f5bdd2014-04-26 21:15:56 +0300189Q(write)
John R. Lenton07205ec2014-01-13 02:31:00 +0000190Q(zip)
Damien Georgeeb7bfcb2014-01-04 15:57:35 +0000191
Damien George48815662014-04-02 10:34:44 +0100192Q(sep)
193Q(end)
194
Damien Georgec12b2212014-03-26 20:15:40 +0000195Q(clear)
196Q(copy)
197Q(fromkeys)
198Q(get)
199Q(items)
200Q(keys)
201Q(pop)
202Q(popitem)
203Q(setdefault)
204Q(update)
205Q(values)
Damien Georgeeb7bfcb2014-01-04 15:57:35 +0000206Q(append)
Damien Georgec12b2212014-03-26 20:15:40 +0000207Q(close)
208Q(send)
209Q(throw)
210Q(count)
211Q(extend)
212Q(index)
213Q(remove)
214Q(insert)
Damien Georgeeb7bfcb2014-01-04 15:57:35 +0000215Q(pop)
216Q(sort)
217Q(join)
xbe7b0f39f2014-01-08 14:23:45 -0800218Q(strip)
Paul Sokolovsky88107842014-04-26 06:20:08 +0300219Q(lstrip)
220Q(rstrip)
Damien Georgeeb7bfcb2014-01-04 15:57:35 +0000221Q(format)
Damien George7d0bfbe2014-02-08 19:01:47 +0000222Q(key)
223Q(reverse)
Damien Georgec12b2212014-03-26 20:15:40 +0000224Q(add)
225Q(clear)
226Q(copy)
227Q(discard)
228Q(difference)
229Q(difference_update)
230Q(intersection)
231Q(intersection_update)
232Q(isdisjoint)
233Q(issubset)
234Q(issuperset)
235Q(pop)
236Q(remove)
237Q(symmetric_difference)
238Q(symmetric_difference_update)
239Q(union)
240Q(update)
241Q(find)
242Q(rfind)
xbe3d9a39e2014-04-08 11:42:19 -0700243Q(rindex)
Damien Georgec12b2212014-03-26 20:15:40 +0000244Q(split)
Paul Sokolovsky2a273652014-05-13 08:07:08 +0300245Q(rsplit)
Damien Georgec12b2212014-03-26 20:15:40 +0000246Q(startswith)
Paul Sokolovskyd098c6b2014-05-24 22:46:51 +0300247Q(endswith)
Damien Georgec12b2212014-03-26 20:15:40 +0000248Q(replace)
249Q(partition)
250Q(rpartition)
Paul Sokolovsky69135212014-05-10 19:47:41 +0300251Q(lower)
252Q(upper)
Kim Bautersa3f4b832014-05-31 07:30:03 +0100253Q(isspace)
254Q(isalpha)
255Q(isdigit)
256Q(isupper)
257Q(islower)
Damien George491cbd62014-05-06 16:38:54 +0000258Q(iterable)
259Q(start)
Paul Sokolovskyab5d0822014-01-24 00:22:00 +0200260
Damien Georgea71c83a2014-02-15 11:34:50 +0000261Q(bound_method)
262Q(closure)
263Q(dict_view)
264Q(function)
265Q(generator)
266Q(iterator)
267Q(module)
268Q(slice)
269
Damien Georgefb510b32014-06-01 13:32:54 +0100270#if MICROPY_PY_BUILTINS_FROZENSET
Paul Sokolovskyb181b582014-05-10 16:02:17 +0300271Q(frozenset)
272#endif
273
Damien Georgeee3fd462014-05-24 23:03:12 +0100274#if MICROPY_PY_MATH || MICROPY_PY_CMATH
Damien George0c36da02014-03-08 15:24:39 +0000275Q(math)
Damien Georgea9256392014-03-20 16:39:22 +0000276Q(e)
Damien George0c36da02014-03-08 15:24:39 +0000277Q(pi)
278Q(sqrt)
279Q(pow)
280Q(exp)
Damien George8854e1f2014-03-12 21:31:41 +0000281Q(expm1)
Damien George0c36da02014-03-08 15:24:39 +0000282Q(log)
283Q(log2)
284Q(log10)
285Q(cosh)
286Q(sinh)
287Q(tanh)
288Q(acosh)
289Q(asinh)
290Q(atanh)
291Q(cos)
292Q(sin)
293Q(tan)
294Q(acos)
295Q(asin)
296Q(atan)
297Q(atan2)
Rachel Dowdall5a14a1d2014-03-20 21:26:51 +0000298Q(ceil)
299Q(copysign)
300Q(fabs)
Rachel Dowdall5a14a1d2014-03-20 21:26:51 +0000301Q(fmod)
Rachel Dowdall249b9c72014-03-22 14:39:33 +0000302Q(floor)
Rachel Dowdall5a14a1d2014-03-20 21:26:51 +0000303Q(isfinite)
304Q(isinf)
305Q(isnan)
306Q(trunc)
Rachel Dowdall249b9c72014-03-22 14:39:33 +0000307Q(modf)
308Q(frexp)
309Q(ldexp)
310Q(degrees)
311Q(radians)
312Q(erf)
313Q(erfc)
314Q(gamma)
315Q(lgamma)
Damien Georgedbdfee12014-04-17 17:11:03 +0100316#endif
317
Damien Georgeee3fd462014-05-24 23:03:12 +0100318#if MICROPY_PY_CMATH
Damien Georgedbdfee12014-04-17 17:11:03 +0100319Q(cmath)
320Q(phase)
321Q(polar)
322Q(rect)
323#endif
Damien George0c36da02014-03-08 15:24:39 +0000324
325Q(mem_total)
326Q(mem_current)
327Q(mem_peak)
328
Dave Hylands5b7fd202014-07-01 23:46:53 -0700329#if MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF && (MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE == 0)
330Q(alloc_emergency_exception_buf)
331#endif
332
Paul Sokolovskyab5d0822014-01-24 00:22:00 +0200333Q(<module>)
334Q(<lambda>)
335Q(<listcomp>)
336Q(<dictcomp>)
337Q(<setcomp>)
338Q(<genexpr>)
Damien Georgeb829b5c2014-01-25 13:51:19 +0000339Q(<string>)
Paul Sokolovskyab5d0822014-01-24 00:22:00 +0200340Q(<stdin>)
Paul Sokolovsky73b70272014-04-13 05:28:46 +0300341
342#if MICROPY_CPYTHON_COMPAT
343Q(encode)
344Q(decode)
345Q(utf-8)
346#endif
Paul Sokolovskya3e50ea2014-04-13 06:55:24 +0300347
Damien Georgeee3fd462014-05-24 23:03:12 +0100348#if MICROPY_PY_SYS
Paul Sokolovskya3e50ea2014-04-13 06:55:24 +0300349Q(argv)
Paul Sokolovsky978d2c02014-04-13 09:53:52 +0300350Q(byteorder)
351Q(big)
Paul Sokolovskyd99e9082014-05-10 16:50:45 +0300352Q(exit)
Paul Sokolovsky978d2c02014-04-13 09:53:52 +0300353Q(little)
Paul Sokolovskyb9b93542014-06-07 23:40:04 +0300354#ifdef MICROPY_PY_SYS_PLATFORM
355Q(platform)
356#endif
Paul Sokolovskya3e50ea2014-04-13 06:55:24 +0300357Q(stdin)
358Q(stdout)
359Q(stderr)
Paul Sokolovskybbae42d2014-04-14 01:46:45 +0300360Q(version)
Paul Sokolovskybaaaf652014-04-13 09:46:58 +0300361Q(version_info)
Paul Sokolovsky4e0eeeb2014-07-03 16:50:11 +0300362#if MICROPY_PY_SYS_MAXSIZE
363Q(maxsize)
364#endif
Paul Sokolovskya3e50ea2014-04-13 06:55:24 +0300365#endif
Damien George777b0f32014-04-13 18:59:45 +0100366
Damien Georgeee3fd462014-05-24 23:03:12 +0100367#if MICROPY_PY_STRUCT
Paul Sokolovsky62044602014-04-19 03:13:15 +0300368Q(struct)
369Q(pack)
370Q(unpack)
371#endif
372
Paul Sokolovsky82158472014-06-28 03:03:47 +0300373#if MICROPY_PY_UCTYPES
374Q(uctypes)
375Q(sizeof)
376Q(addressof)
377Q(bytes_at)
378Q(bytearray_at)
379
380Q(NATIVE)
381Q(LITTLE_ENDIAN)
382Q(BIG_ENDIAN)
383
384Q(VOID)
385
386Q(UINT8)
387Q(INT8)
388Q(UINT16)
389Q(INT16)
390Q(UINT32)
391Q(INT32)
392Q(UINT64)
393Q(INT64)
394
395Q(BFUINT8)
396Q(BFINT8)
397Q(BFUINT16)
398Q(BFINT16)
399Q(BFUINT32)
400Q(BFINT32)
401
402Q(FLOAT32)
403Q(FLOAT64)
404
405Q(ARRAY)
406Q(PTR)
407//Q(BITFIELD)
Paul Sokolovsky2097c8b2014-07-11 00:06:36 +0300408
409Q(BF_POS)
410Q(BF_LEN)
Paul Sokolovsky82158472014-06-28 03:03:47 +0300411#endif
412
Damien Georgeee3fd462014-05-24 23:03:12 +0100413#if MICROPY_PY_IO
Paul Sokolovskyfbdf2f12014-06-12 01:22:25 +0300414Q(_io)
Paul Sokolovsky27f5bdd2014-04-26 21:15:56 +0300415Q(readall)
416Q(readline)
Damien Georged5f5b2f2014-05-03 22:01:32 +0100417Q(readlines)
Paul Sokolovsky9e296662014-05-19 20:59:13 +0300418Q(FileIO)
419Q(TextIOWrapper)
Paul Sokolovskycb9dc082014-04-26 20:26:14 +0300420Q(StringIO)
421Q(BytesIO)
422Q(getvalue)
Paul Sokolovskycb66f412014-07-13 23:07:42 +0300423Q(file)
Paul Sokolovskycb9dc082014-04-26 20:26:14 +0300424#endif
425
Damien Georgeee3fd462014-05-24 23:03:12 +0100426#if MICROPY_PY_GC
Paul Sokolovskyf9e54e02014-05-06 02:16:43 +0300427Q(gc)
428Q(collect)
Damien George8c1c7482014-05-08 23:04:49 +0100429Q(disable)
430Q(enable)
Paul Sokolovsky5aa740c2014-06-24 21:23:40 +0300431Q(mem_free)
432Q(mem_alloc)
Paul Sokolovskyf9e54e02014-05-06 02:16:43 +0300433#endif
434
Damien Georgefb510b32014-06-01 13:32:54 +0100435#if MICROPY_PY_BUILTINS_PROPERTY
Damien George777b0f32014-04-13 18:59:45 +0100436Q(property)
437Q(getter)
438Q(setter)
439Q(deleter)
440#endif