2014-05-03 18:27:38 -04:00
|
|
|
/*
|
|
|
|
* This file is part of the Micro Python project, http://micropython.org/
|
|
|
|
*
|
|
|
|
* The MIT License (MIT)
|
|
|
|
*
|
|
|
|
* Copyright (c) 2013, 2014 Damien P. George
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
* THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
2014-04-11 13:50:15 -04:00
|
|
|
#include "mpconfig.h"
|
2014-01-04 10:57:35 -05:00
|
|
|
// All the qstr definitions in this file are available as constants.
|
2014-03-08 10:24:39 -05:00
|
|
|
// That is, they are in ROM and you can reference them simply as MP_QSTR_xxxx.
|
2014-01-04 10:57:35 -05:00
|
|
|
|
2014-04-27 14:23:46 -04:00
|
|
|
Q(*)
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(__build_class__)
|
|
|
|
Q(__class__)
|
|
|
|
Q(__doc__)
|
2014-02-03 17:46:17 -05:00
|
|
|
Q(__import__)
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(__init__)
|
|
|
|
Q(__locals__)
|
|
|
|
Q(__main__)
|
|
|
|
Q(__module__)
|
|
|
|
Q(__name__)
|
|
|
|
Q(__next__)
|
|
|
|
Q(__qualname__)
|
2014-04-11 16:25:35 -04:00
|
|
|
Q(__path__)
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(__repl_print__)
|
|
|
|
|
2014-01-30 05:05:33 -05:00
|
|
|
Q(__bool__)
|
2014-04-13 03:39:25 -04:00
|
|
|
Q(__contains__)
|
2014-03-28 22:10:11 -04:00
|
|
|
Q(__enter__)
|
|
|
|
Q(__exit__)
|
2014-01-30 05:05:33 -05:00
|
|
|
Q(__len__)
|
2014-03-26 14:37:06 -04:00
|
|
|
Q(__iter__)
|
2014-01-24 19:17:36 -05:00
|
|
|
Q(__getitem__)
|
2014-02-08 14:01:47 -05:00
|
|
|
Q(__setitem__)
|
2014-04-13 16:55:59 -04:00
|
|
|
Q(__delitem__)
|
2014-01-24 19:17:36 -05:00
|
|
|
Q(__add__)
|
|
|
|
Q(__sub__)
|
2014-03-16 09:16:54 -04:00
|
|
|
Q(__repr__)
|
|
|
|
Q(__str__)
|
2014-03-31 17:57:56 -04:00
|
|
|
Q(__getattr__)
|
2014-04-05 09:49:03 -04:00
|
|
|
Q(__del__)
|
2014-04-25 14:15:16 -04:00
|
|
|
Q(__call__)
|
2014-01-24 19:17:36 -05:00
|
|
|
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(micropython)
|
|
|
|
Q(byte_code)
|
|
|
|
Q(native)
|
|
|
|
Q(viper)
|
2014-04-21 08:33:15 -04:00
|
|
|
|
|
|
|
#if MICROPY_EMIT_INLINE_THUMB
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(asm_thumb)
|
2014-04-21 08:33:15 -04:00
|
|
|
Q(label)
|
|
|
|
Q(align)
|
|
|
|
Q(data)
|
|
|
|
#endif
|
2014-01-04 10:57:35 -05:00
|
|
|
|
2014-01-04 13:44:46 -05:00
|
|
|
Q(Ellipsis)
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(StopIteration)
|
|
|
|
|
2014-02-15 11:10:44 -05:00
|
|
|
Q(BaseException)
|
2014-03-22 11:28:16 -04:00
|
|
|
Q(ArithmeticError)
|
2014-01-04 15:21:15 -05:00
|
|
|
Q(AssertionError)
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(AttributeError)
|
2014-03-22 11:28:16 -04:00
|
|
|
Q(BufferError)
|
|
|
|
Q(EOFError)
|
|
|
|
Q(Exception)
|
|
|
|
Q(FileExistsError)
|
|
|
|
Q(FileNotFoundError)
|
|
|
|
Q(FloatingPointError)
|
|
|
|
Q(GeneratorExit)
|
|
|
|
Q(IOError)
|
2014-02-03 20:33:55 -05:00
|
|
|
Q(ImportError)
|
2014-01-15 16:23:31 -05:00
|
|
|
Q(IndentationError)
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(IndexError)
|
|
|
|
Q(KeyError)
|
2014-03-22 11:28:16 -04:00
|
|
|
Q(LookupError)
|
|
|
|
Q(MemoryError)
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(NameError)
|
2014-02-09 06:17:36 -05:00
|
|
|
Q(NotImplementedError)
|
2014-01-15 16:23:31 -05:00
|
|
|
Q(OSError)
|
2014-03-22 11:28:16 -04:00
|
|
|
Q(OverflowError)
|
|
|
|
Q(RuntimeError)
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(SyntaxError)
|
2014-03-22 11:28:16 -04:00
|
|
|
Q(SystemError)
|
2014-01-04 15:21:15 -05:00
|
|
|
Q(TypeError)
|
2014-03-22 11:28:16 -04:00
|
|
|
Q(UnboundLocalError)
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(ValueError)
|
2014-03-20 18:40:38 -04:00
|
|
|
Q(ZeroDivisionError)
|
2014-01-04 10:57:35 -05:00
|
|
|
|
2014-03-22 17:31:28 -04:00
|
|
|
Q(None)
|
|
|
|
Q(False)
|
|
|
|
Q(True)
|
|
|
|
Q(object)
|
2014-03-22 11:28:16 -04:00
|
|
|
|
2014-02-15 06:34:50 -05:00
|
|
|
Q(NoneType)
|
|
|
|
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(abs)
|
|
|
|
Q(all)
|
|
|
|
Q(any)
|
2014-03-24 19:29:09 -04:00
|
|
|
Q(args)
|
2014-01-18 12:24:47 -05:00
|
|
|
Q(array)
|
2014-04-15 17:03:55 -04:00
|
|
|
Q(bin)
|
|
|
|
Q({:#b})
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(bool)
|
2014-01-18 12:24:47 -05:00
|
|
|
Q(bytearray)
|
2014-01-20 13:32:50 -05:00
|
|
|
Q(bytes)
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(callable)
|
2014-04-09 20:45:38 -04:00
|
|
|
#if MICROPY_ENABLE_MOD_STRUCT
|
|
|
|
Q(calcsize)
|
|
|
|
#endif
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(chr)
|
2014-02-06 15:31:44 -05:00
|
|
|
Q(classmethod)
|
2014-04-13 03:17:04 -04:00
|
|
|
Q(_collections)
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(complex)
|
|
|
|
Q(dict)
|
2014-02-02 17:07:44 -05:00
|
|
|
Q(dir)
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(divmod)
|
2014-01-14 18:55:01 -05:00
|
|
|
Q(enumerate)
|
2014-01-15 17:14:03 -05:00
|
|
|
Q(eval)
|
2014-02-03 17:44:10 -05:00
|
|
|
Q(exec)
|
2014-01-14 20:37:08 -05:00
|
|
|
Q(filter)
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(float)
|
2014-04-08 17:40:58 -04:00
|
|
|
Q(from_bytes)
|
2014-03-26 17:35:13 -04:00
|
|
|
Q(getattr)
|
2014-04-05 18:00:46 -04:00
|
|
|
Q(globals)
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(hash)
|
2014-04-15 07:42:52 -04:00
|
|
|
Q(hex)
|
2014-04-15 07:50:21 -04:00
|
|
|
Q(%#x)
|
2014-02-01 22:00:41 -05:00
|
|
|
Q(id)
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(int)
|
2014-01-09 16:43:51 -05:00
|
|
|
Q(isinstance)
|
|
|
|
Q(issubclass)
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(iter)
|
|
|
|
Q(len)
|
|
|
|
Q(list)
|
2014-04-05 18:00:46 -04:00
|
|
|
Q(locals)
|
2014-01-14 20:10:09 -05:00
|
|
|
Q(map)
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(max)
|
|
|
|
Q(min)
|
2014-02-27 15:22:04 -05:00
|
|
|
Q(namedtuple)
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(next)
|
2014-04-15 17:03:55 -04:00
|
|
|
Q(oct)
|
|
|
|
Q(%#o)
|
2014-04-05 18:02:23 -04:00
|
|
|
Q(open)
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(ord)
|
2014-02-04 17:47:06 -05:00
|
|
|
Q(path)
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(pow)
|
|
|
|
Q(print)
|
|
|
|
Q(range)
|
2014-04-26 14:15:56 -04:00
|
|
|
Q(read)
|
2014-01-15 16:40:48 -05:00
|
|
|
Q(repr)
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(set)
|
2014-01-13 00:12:50 -05:00
|
|
|
Q(sorted)
|
2014-02-06 15:31:44 -05:00
|
|
|
Q(staticmethod)
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(sum)
|
2014-02-04 19:51:47 -05:00
|
|
|
Q(super)
|
2014-01-13 12:20:46 -05:00
|
|
|
Q(str)
|
2014-02-04 00:55:10 -05:00
|
|
|
Q(sys)
|
2014-04-08 17:40:58 -04:00
|
|
|
Q(to_bytes)
|
2014-01-04 15:21:15 -05:00
|
|
|
Q(tuple)
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(type)
|
2014-03-24 19:29:09 -04:00
|
|
|
Q(value)
|
2014-04-26 14:15:56 -04:00
|
|
|
Q(write)
|
2014-01-12 21:31:00 -05:00
|
|
|
Q(zip)
|
2014-01-04 10:57:35 -05:00
|
|
|
|
2014-04-02 05:34:44 -04:00
|
|
|
Q(sep)
|
|
|
|
Q(end)
|
|
|
|
|
2014-03-26 16:15:40 -04:00
|
|
|
Q(clear)
|
|
|
|
Q(copy)
|
|
|
|
Q(fromkeys)
|
|
|
|
Q(get)
|
|
|
|
Q(items)
|
|
|
|
Q(keys)
|
|
|
|
Q(pop)
|
|
|
|
Q(popitem)
|
|
|
|
Q(setdefault)
|
|
|
|
Q(update)
|
|
|
|
Q(values)
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(append)
|
2014-03-26 16:15:40 -04:00
|
|
|
Q(close)
|
|
|
|
Q(send)
|
|
|
|
Q(throw)
|
|
|
|
Q(count)
|
|
|
|
Q(extend)
|
|
|
|
Q(index)
|
|
|
|
Q(remove)
|
|
|
|
Q(insert)
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(pop)
|
|
|
|
Q(sort)
|
|
|
|
Q(join)
|
2014-01-08 17:23:45 -05:00
|
|
|
Q(strip)
|
2014-04-25 23:20:08 -04:00
|
|
|
Q(lstrip)
|
|
|
|
Q(rstrip)
|
2014-01-04 10:57:35 -05:00
|
|
|
Q(format)
|
2014-02-08 14:01:47 -05:00
|
|
|
Q(key)
|
|
|
|
Q(reverse)
|
2014-03-26 16:15:40 -04:00
|
|
|
Q(add)
|
|
|
|
Q(clear)
|
|
|
|
Q(copy)
|
|
|
|
Q(discard)
|
|
|
|
Q(difference)
|
|
|
|
Q(difference_update)
|
|
|
|
Q(intersection)
|
|
|
|
Q(intersection_update)
|
|
|
|
Q(isdisjoint)
|
|
|
|
Q(issubset)
|
|
|
|
Q(issuperset)
|
|
|
|
Q(pop)
|
|
|
|
Q(remove)
|
|
|
|
Q(symmetric_difference)
|
|
|
|
Q(symmetric_difference_update)
|
|
|
|
Q(union)
|
|
|
|
Q(update)
|
|
|
|
Q(find)
|
|
|
|
Q(rfind)
|
2014-04-08 14:42:19 -04:00
|
|
|
Q(rindex)
|
2014-03-26 16:15:40 -04:00
|
|
|
Q(split)
|
|
|
|
Q(startswith)
|
|
|
|
Q(replace)
|
|
|
|
Q(partition)
|
|
|
|
Q(rpartition)
|
2014-01-23 17:22:00 -05:00
|
|
|
|
2014-02-15 06:34:50 -05:00
|
|
|
Q(bound_method)
|
|
|
|
Q(closure)
|
|
|
|
Q(dict_view)
|
|
|
|
Q(function)
|
|
|
|
Q(generator)
|
|
|
|
Q(iterator)
|
|
|
|
Q(module)
|
|
|
|
Q(slice)
|
|
|
|
|
2014-04-17 12:11:03 -04:00
|
|
|
#if MICROPY_ENABLE_MOD_MATH || MICROPY_ENABLE_MOD_CMATH
|
2014-03-08 10:24:39 -05:00
|
|
|
Q(math)
|
2014-03-20 12:39:22 -04:00
|
|
|
Q(e)
|
2014-03-08 10:24:39 -05:00
|
|
|
Q(pi)
|
|
|
|
Q(sqrt)
|
|
|
|
Q(pow)
|
|
|
|
Q(exp)
|
2014-03-12 17:31:41 -04:00
|
|
|
Q(expm1)
|
2014-03-08 10:24:39 -05:00
|
|
|
Q(log)
|
|
|
|
Q(log2)
|
|
|
|
Q(log10)
|
|
|
|
Q(cosh)
|
|
|
|
Q(sinh)
|
|
|
|
Q(tanh)
|
|
|
|
Q(acosh)
|
|
|
|
Q(asinh)
|
|
|
|
Q(atanh)
|
|
|
|
Q(cos)
|
|
|
|
Q(sin)
|
|
|
|
Q(tan)
|
|
|
|
Q(acos)
|
|
|
|
Q(asin)
|
|
|
|
Q(atan)
|
|
|
|
Q(atan2)
|
2014-03-20 17:26:51 -04:00
|
|
|
Q(ceil)
|
|
|
|
Q(copysign)
|
|
|
|
Q(fabs)
|
|
|
|
Q(fmod)
|
2014-03-22 10:39:33 -04:00
|
|
|
Q(floor)
|
2014-03-20 17:26:51 -04:00
|
|
|
Q(isfinite)
|
|
|
|
Q(isinf)
|
|
|
|
Q(isnan)
|
|
|
|
Q(trunc)
|
2014-03-22 10:39:33 -04:00
|
|
|
Q(modf)
|
|
|
|
Q(frexp)
|
|
|
|
Q(ldexp)
|
|
|
|
Q(degrees)
|
|
|
|
Q(radians)
|
|
|
|
Q(erf)
|
|
|
|
Q(erfc)
|
|
|
|
Q(gamma)
|
|
|
|
Q(lgamma)
|
2014-04-17 12:11:03 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if MICROPY_ENABLE_MOD_CMATH
|
|
|
|
Q(cmath)
|
|
|
|
Q(phase)
|
|
|
|
Q(polar)
|
|
|
|
Q(rect)
|
|
|
|
#endif
|
2014-03-08 10:24:39 -05:00
|
|
|
|
|
|
|
Q(mem_total)
|
|
|
|
Q(mem_current)
|
|
|
|
Q(mem_peak)
|
|
|
|
|
2014-01-23 17:22:00 -05:00
|
|
|
Q(<module>)
|
|
|
|
Q(<lambda>)
|
|
|
|
Q(<listcomp>)
|
|
|
|
Q(<dictcomp>)
|
|
|
|
Q(<setcomp>)
|
|
|
|
Q(<genexpr>)
|
2014-01-25 08:51:19 -05:00
|
|
|
Q(<string>)
|
2014-01-23 17:22:00 -05:00
|
|
|
Q(<stdin>)
|
2014-04-12 22:28:46 -04:00
|
|
|
|
|
|
|
#if MICROPY_CPYTHON_COMPAT
|
|
|
|
Q(encode)
|
|
|
|
Q(decode)
|
|
|
|
Q(utf-8)
|
|
|
|
#endif
|
2014-04-12 23:55:24 -04:00
|
|
|
|
|
|
|
#if MICROPY_ENABLE_MOD_SYS
|
|
|
|
Q(argv)
|
2014-04-13 02:53:52 -04:00
|
|
|
Q(byteorder)
|
|
|
|
Q(big)
|
|
|
|
Q(little)
|
2014-04-12 23:55:24 -04:00
|
|
|
Q(stdin)
|
|
|
|
Q(stdout)
|
|
|
|
Q(stderr)
|
2014-04-13 18:46:45 -04:00
|
|
|
Q(version)
|
2014-04-13 02:46:58 -04:00
|
|
|
Q(version_info)
|
2014-04-12 23:55:24 -04:00
|
|
|
#endif
|
2014-04-13 13:59:45 -04:00
|
|
|
|
2014-04-18 20:13:15 -04:00
|
|
|
#if MICROPY_ENABLE_MOD_STRUCT
|
|
|
|
Q(struct)
|
|
|
|
Q(pack)
|
|
|
|
Q(unpack)
|
|
|
|
#endif
|
|
|
|
|
2014-04-26 13:26:14 -04:00
|
|
|
#if MICROPY_ENABLE_MOD_IO
|
|
|
|
Q(io)
|
2014-04-26 14:15:56 -04:00
|
|
|
Q(readall)
|
|
|
|
Q(readline)
|
2014-05-03 17:01:32 -04:00
|
|
|
Q(readlines)
|
2014-04-26 13:26:14 -04:00
|
|
|
Q(StringIO)
|
|
|
|
Q(BytesIO)
|
|
|
|
Q(getvalue)
|
|
|
|
#endif
|
|
|
|
|
2014-05-05 19:16:43 -04:00
|
|
|
#if MICROPY_ENABLE_MOD_GC
|
|
|
|
Q(gc)
|
|
|
|
Q(collect)
|
|
|
|
#endif
|
|
|
|
|
2014-04-13 13:59:45 -04:00
|
|
|
#if MICROPY_ENABLE_PROPERTY
|
|
|
|
Q(property)
|
|
|
|
Q(getter)
|
|
|
|
Q(setter)
|
|
|
|
Q(deleter)
|
|
|
|
#endif
|