418 Commits (de5a9d72dcdaacdd5048195cd5bab007f4b2baef)

Author SHA1 Message Date
Damien George 3f52262465 py: Allow tail call optimisation in mp_call_function_n_kw.
9 years ago
Paul Sokolovsky d3439d0c60 py: Instead of having "debug on" var, have "optimization level" var.
9 years ago
Damien George c49ddb9315 py: Fix configurability of builtin slice.
9 years ago
Damien George 3ebd4d0cae py: Add option to disable set() object (enabled by default).
9 years ago
Damien George fb510b3bf9 Rename bultins config variables to MICROPY_PY_BUILTINS_*.
9 years ago
Damien George d1e355ea8e py: Fix check of small-int overflow when parsing ints.
9 years ago
Damien George 503d611033 py: Implement long int parsing in int(...).
9 years ago
Damien George 6ac5dced24 py: Rename MP_OBJ_NOT_SUPPORTED to MP_OBJ_NULL.
9 years ago
Damien George 915197a8f9 py: Remove emit_glue init and deinit. Needed only for debugging.
9 years ago
Damien George 97f9a2813e py: Add support for __debug__ constant.
9 years ago
Paul Sokolovsky c48d6f7add py: Don't expect that type->getiter() always returns iterator, check for NULL.
9 years ago
Paul Sokolovsky 9511f60f01 py: Don't try to "bind" types store as attributes of objects.
9 years ago
Paul Sokolovsky d915a52eb6 py: Fix prefix on few sequence helpers, was incorrectly "mp_".
9 years ago
stijn 5ed284a15e windows: Add modtime implementation
9 years ago
stijn 01d6be4d51 Windows MSVC port
9 years ago
Damien George a32c1e41cc py: Improve native emitter; now supports more opcodes.
9 years ago
Damien George 36db6bcf54 py, compiler: Improve passes; add an extra pass for native emitter.
9 years ago
Damien George 04b9147e15 Add license header to (almost) all files.
9 years ago
stijn 72521a1c17 mingw: Fix number of exponent digits in floating point formatting
9 years ago
Paul Sokolovsky f54bcbf099 py, unix: Make "mpconfig.h" be first included, as other headers depend on it.
9 years ago
Paul Sokolovsky 755565d2cb py: Support instance __call__ method.
9 years ago
Paul Sokolovsky 599bbc111c py: from import * should not import symbols starting with underscore.
9 years ago
Damien George ea8d06c39d py: Add MP_OBJ_STOP_ITERATION and make good use of it.
9 years ago
Damien George 729f7b42d6 py: Merge BINARY_OP_SUBSCR and store_subscr (w/ delete) into subscr.
9 years ago
Damien George 8bcb9861a7 py: Don't assert but go to unsupported_op in mp_binary_op for small int.
9 years ago
Damien George 640e7e4779 Merge pull request #476 from pfalcon/static-sys
9 years ago
Damien George df8127a17e py: Remove unique_codes from emitglue.c. Replace with pointers.
9 years ago
Paul Sokolovsky 5500cdeec7 py, unix: Convert sys module to static representation.
9 years ago
Damien George f7e4e1c2b4 py: Fix compiler warning when floats disabled.
9 years ago
Paul Sokolovsky 42453dc98e py: Make ImportError message match CPython's.
9 years ago
Paul Sokolovsky 69f1867da5 builtinimport: Fix thinko passing 0 vs NULL.
9 years ago
Paul Sokolovsky af620abcb5 py: Implement "from pkg import mod" variant of import.
9 years ago
Damien George ae491055fa py: Fix float/complex binop returning NULL; implement complex power.
9 years ago
Damien George f4c9b33abf py: Remove DELETE_SUBSCR opcode, combine with STORE_SUBSCR.
9 years ago
Damien George 1d24ea5207 py: Finish implementation of all del opcodes.
9 years ago
Damien George 495d781a36 py: implement UNPACK_EX byte code (for: a, *b, c = d)
9 years ago
Damien George cdd96dff2c py: Implement more features in native emitter.
9 years ago
Paul Sokolovsky 36dd19ae27 py: Revert mp_load_attr() to its previous state (not supporting default val).
9 years ago
Damien George 7efc5b3f34 py: Make globals and locals proper dictionary objects.
9 years ago
Damien George 8b0535e23f py: Change module globals from mp_map_t* to mp_obj_dict_t*.
9 years ago
Damien George ea13f407a3 py: Change nlr_jump to nlr_raise, to aid in debugging.
9 years ago
Damien George 23419a2f8a Merge pull request #433 from pfalcon/getattr-3arg
9 years ago
Damien George 66edc5d899 py: Implement DELETE_SUBSCR bytecode; implement mp_obj_dict_delete.
9 years ago
Paul Sokolovsky bfb7d6a26d py: Support 3-arg getattr() builtin (with default value).
9 years ago
Paul Sokolovsky c6813d92db py: Put default namespace into module __main__.
9 years ago
Paul Sokolovsky a0d32991ed mp_load_name(): Optimize for outer scope where locals == globals.
9 years ago
Damien George ecf5b77123 py: This time, real proper overflow checking of small int power.
9 years ago
Damien George 6902eeda25 py: Add m_malloc_fail function to handle memory allocation error.
9 years ago
Damien George 5bf565e353 py: Handle small int power overflow correctly.
9 years ago
Damien George 70f33cde48 py: Fix up so that it can compile without float.
9 years ago
Damien George e44d26ae0c py: Implement __getattr__.
9 years ago
Paul Sokolovsky 6ce78c4fae py: Wrap .__class__ handling in MICROPY_CPYTHON_COMPAT.
9 years ago
Damien George 43e92cfb52 Merge branch 'master' of github.com:micropython/micropython
9 years ago
Damien George 15d18069c5 py: Remove old "run time" functions that were 1 liners.
9 years ago
Paul Sokolovsky 7da0660516 mp_resume: Dare to pass send_value of NULL.
9 years ago
Paul Sokolovsky a2109d9321 mp_resume: Elaborate handling of .throw() for objects which lack it.
9 years ago
Damien George 1aa2c10263 Merge branch 'master' of github.com:micropython/micropython
9 years ago
Damien George 523b575039 py: Add LOAD_NULL bytecode and use it to simplify function calls.
9 years ago
Paul Sokolovsky 6ded55a61f py: Properly implement divide-by-zero handling.
9 years ago
Paul Sokolovsky f39d3b93da py: Implement support for generalized generator protocol.
9 years ago
Damien George 230fec77d7 py: Implement positional and keyword args via * and **.
9 years ago
Damien George df6567e634 Merge map.h into obj.h.
9 years ago
Damien George d17926db71 Rename rt_* to mp_*.
9 years ago
Damien George 3e1a5c10c5 py: Rename old const type objects to mp_type_* for consistency.
9 years ago
Damien George 07ddab529c py: Change mp_const_* objects to macros.
9 years ago
Damien George 440f041525 py: Fix bugs with debugging output.
9 years ago
Damien George 2326d52d20 py: Factor out code from runtime.c to emitglue.c.
9 years ago
Damien George bee17b00e3 py: Put n_state for bytecode in the bytecode prelude.
9 years ago
Damien George d6f9434091 Merge pull request #381 from pfalcon/closure-defargs
9 years ago
Damien George c3f1126ee8 py: Fix logic bugs in object attribute/method extraction.
9 years ago
Damien George 9b196cddab Remove mp_obj_type_t.methods entry and use .locals_dict instead.
9 years ago
Paul Sokolovsky 2447a5b582 py: Support closures with default args.
9 years ago
Damien George c12b2213c1 Change mp_method_t.name from const char * to qstr.
9 years ago
Damien George 66eaf84b8c py: Replace mp_const_stop_iteration object with MP_OBJ_NULL.
9 years ago
Damien George 9e6e935df0 py: Add support for user-defined iterators via __iter__, __next__.
9 years ago
Damien George caac542b23 Proper support for registering builtin modules in ROM.
9 years ago
Paul Sokolovsky 7f8b31345b rt_load_method(): Add missing qstr_str() when getting type name.
9 years ago
Paul Sokolovsky f909034400 py: Implement support for "except Exception as var" clause.
9 years ago
Paul Sokolovsky 4b2b7ceca7 runtime: RT_BINARY_OP_EXCEPTION_MATCH: don't fall thru in case of wrong types.
9 years ago
Damien George c91097223d py: Remove some unnecessary exception objects.
9 years ago
Damien George 3ec0a1a32d py: Add 'object' object.
9 years ago
Rachel Dowdall 56402796d8 Fixed floor division on mp ints and small ints. Added a floordivide test case.
9 years ago
Rachel Dowdall cde8631f15 Fixed modulo operator on ints and mp ints to agree with python. Added intdivmod.c and tests/basics/modulo.py.
9 years ago
Rachel Dowdall 721c55dced Added exception hierarchy except for OSError and UnicodeError (requires arguments). Comment out the errors that aren't needed if memory becomes an issue.
9 years ago
Rachel Dowdall 17f45d41fe Merge remote-tracking branch 'upstream/master'
9 years ago
Paul Sokolovsky 1ecea7c753 py: Make 'bytes' be a proper type, support standard constructor args.
9 years ago
Paul Sokolovsky be020c27a8 py: Make 'str' be a proper type, support standard constructor args.
9 years ago
Damien George 6e48f7fa85 py: Allow 'complex()' to take a string as first argument.
9 years ago
Damien George c06ea7abf2 py: Implement parsing of infinity and nan for floats.
9 years ago
Rachel Dowdall 300c8bd4c2 Added ZeroDivisionError to float division.
9 years ago
xbe efe3422394 py: Clean up includes.
9 years ago
Damien George 9d68e9ccdd py: Implement integer overflow checking for * and << ops.
9 years ago
Damien George 0ec6bd47cb py: Fix printing of type name.
9 years ago
Damien George 0c36da0b59 Implement ROMable modules. Add math module.
9 years ago
Damien George 715101580b py: Factor and improve issubclass.
9 years ago
Paul Sokolovsky d08fd68664 Add basic collections.namedtuple implementation.
9 years ago
Damien George 41eb6086b7 py: Remove more var arg names fro macros with var args.
9 years ago
Damien George 510477557d py: Take out bitfield entries from their own structure.
9 years ago
Damien George 2077397118 py: Put number parsing code together in parsenum.c.
9 years ago
Paul Sokolovsky ac2e28c654 Support passing positional args as keywords to bytecode functions.
9 years ago
Paul Sokolovsky 44739e280e Make DEBUG_printf() a proper function, implementation is port-dependent.
9 years ago
Damien George 2e482cdb7b py: Implement *vargs support.
9 years ago
Damien George 22a0865d54 py: Improve exception bases, reduces ROM usage.
9 years ago
Damien George 8725f8f7de py: Pass all scope flags through to runtime.
9 years ago
Damien George c5966128c7 Implement proper exception type hierarchy.
9 years ago
Damien George 7ef098000a Merge pull request #288 from pfalcon/port-builtins
9 years ago
Paul Sokolovsky 910843e86d Allow ports to define statically builtin functions.
9 years ago
Paul Sokolovsky da1ce93da8 Implement "from module import *" construct.
9 years ago
Paul Sokolovsky 520e2f58a5 Replace global "static" -> "STATIC", to allow "analysis builds". Part 2.
9 years ago
Damien George 8c2b333aff Merge branch 'master' of github.com:micropython/micropython
9 years ago
Paul Sokolovsky 76f06de96d Add NotImplementedError.
9 years ago
Damien George 7d0bfbedd2 py: Add some qstrs to the global table.
9 years ago
Damien George aea532ece1 py: Put builtins into ROM table.
9 years ago
Damien George 64131f3215 Add staticmethod and classmethod to builtin namespace.
9 years ago
Damien George cdcb4906d4 Merge pull request #262 from pfalcon/sys-path
9 years ago
Damien George 35e2a4e6bb py: Add built-in super.
9 years ago
Paul Sokolovsky e11b17c25f Implement support for sys.path when loading modules.
9 years ago
Paul Sokolovsky 0c59db1973 Use qstr id to create sys module.
9 years ago
Paul Sokolovsky 7cd54d79db Add ImportError.
9 years ago
Paul Sokolovsky 1d938c9503 Expose __import__() function.
9 years ago
Damien George ca4767984b py: Implement builtin exec.
9 years ago
Damien George 4acb2452b3 py: Add very basic implementation of dir() builtin.
9 years ago
Damien George 93d004f4b0 Merge branch 'xbe-master'
9 years ago
Damien George 09e1f43200 Merge branch 'master' of github.com:micropython/micropython
9 years ago
Damien George cd82e02e84 py: Partially fix native emitter to work with latest runtime.
9 years ago
xbe 0ebf8534ab Implement and add tests for the id() builtin function.
9 years ago
Paul Sokolovsky edbdf71f5c rt_unpack_sequence(): Support generic iterables.
9 years ago
Damien George 48697f1dd2 Tidy up some comments.
9 years ago
Damien George 9aa2a527b5 py: Tidy up BINARY_OPs; negation done by special NOT bytecode.
9 years ago
Paul Sokolovsky 90750029df Implement default function arguments (for Python functions).
9 years ago
Damien George 8b56beb1a1 py: Simplified rt_call_function_n_kw.
9 years ago
Markus Siemens 2c2a124e16 Fix SIGSEV when running "a"()
9 years ago
Damien George 3f759b71c6 py: Add MICROPY_ENABLE_FLOAT around a float specific piece of code.
9 years ago
Damien George 09a0c64bce py: Improve __bool__ and __len__ dispatch; add slots for them.
9 years ago
Paul Sokolovsky c1d9bbc345 Implement __bool__ and __len__ via unary_op virtual method for all types.
9 years ago
Damien George d0691ccaec py: Simplify fastn in VM; reduce size of unique code struct.
9 years ago
Damien George 08d075592f py: Fix bug with LOAD_METHOD; fix int->machine_int_t for small int.
9 years ago
Damien George e4b6a079b3 py: Implement 'not' in compiler, and improve rt_is_true.
9 years ago
Paul Sokolovsky 0dd0467a97 Don't pre-import array module.
9 years ago
Damien George 4e8dc8c41b py: Add unary op not for NoneType, bool, tuple, list, dict; fix for int.
9 years ago
Damien George 0f5e8b151f Merge branch 'master' of github.com:micropython/micropython
9 years ago
Damien George 7c9c667633 py: Implement iterator support for object that has __getitem__.
9 years ago
Paul Sokolovsky c1d200ef74 rt_deinit(): Finalize some maps.
9 years ago
Paul Sokolovsky 91fb1c9b13 Add basic implementation of bytes type, piggybacking on str.
9 years ago
Damien George 1e708fed18 py: Implement bool unary op; tidy up unary op dispatch.
9 years ago
Damien George 0d028743aa py: Initialise loaded_module map in rt_init.
9 years ago
Damien George 5fa93b6755 Second stage of qstr revamp: uPy str object can be qstr or not.
9 years ago
Damien George 12eaccacda Merge branch 'master' of github.com:micropython/micropython
9 years ago
Damien George 55baff4c9b Revamp qstrs: they now include length and hash.
9 years ago
Paul Sokolovsky a80ff04fe7 Add dummy bytes() constructor.
9 years ago
Damien George 91d457a277 py: Put micropython module init code in builtinmp.c.
9 years ago
Paul Sokolovsky 440cc3f028 Expose memory stats functions via "micropython" module.
9 years ago
Paul Sokolovsky 159c0f75da Don't implicitly import "sys" module.
9 years ago
Paul Sokolovsky f477bfbc75 Pre-create sys module.
9 years ago
Damien George cbd2f7482c py: Add module/function/class name to exceptions.
9 years ago
Damien George 932bf1c48f py: Fix VM/runtime unpack sequence bug, Issue #193.
9 years ago
Damien George 6b21538e91 Merge pull request #192 from pfalcon/arrays
9 years ago
Damien George f49ba1bd9c Improve method lookup in mp_obj_class_lookup.
9 years ago
Paul Sokolovsky 427905cedd Add skeleton implementation of array.array and bytearray.
9 years ago
Damien George 0c4e909e76 Merge pull request #191 from pfalcon/store-item
9 years ago
Damien George 632cf5710c Merge branch 'master' of github.com:dpgeorge/micropython
9 years ago
Damien George 20006dbba9 Make VM stack grow upwards, and so no reversed args arrays.
9 years ago
Paul Sokolovsky 6d8edf6acf Add store_item() virtual method to type to implement container[index] = val.
9 years ago
Paul Sokolovsky 166bb40fb2 Add OverflowError and use it for small int overflow instead of assert.
9 years ago
Paul Sokolovsky 10744dd816 Add empty (false) value testing for strings, tuples, lists, dicts.
9 years ago
Paul Sokolovsky dcac88095b Add empty "micropython" module to allow more seamless CPython portability.
9 years ago
Damien George 4899ff9470 Merge branch 'str-repr' of github.com:pfalcon/micropython into pfalcon-str-repr
9 years ago
Damien George 7a9d0c4540 Merge branch 'builtins' of github.com:chipaca/micropython into chipaca-builtins
9 years ago
Damien George d02c6d8962 Implement eval.
9 years ago
Damien George e2fb2baaa4 Implement repr.
9 years ago
John R. Lenton fca456bc3c added filter()
9 years ago
John R. Lenton 39b174e00a Added map
9 years ago
Paul Sokolovsky 36c4499d36 Implement str() and repr() builtin functions.
9 years ago
John R. Lenton ff8007c7d6 Merge remote-tracking branch 'upstream/master' into builtins
9 years ago
John R. Lenton 9daa78943e added enumerate()
9 years ago
Damien George 66a5bf681d Merge pull request #142 from chipaca/containment
9 years ago
Damien George 6c2401e935 Merge pull request #165 from chipaca/builtins
9 years ago
Paul Sokolovsky 8bc96471f0 Implement "is" and "is not" operators.
9 years ago
John R. Lenton 93451002f0 Merge remote-tracking branch 'upstream/master' into builtins
9 years ago
John R. Lenton f5a0a7d2b3 Merge remote-tracking branch 'upstream/master' into containment
9 years ago
Damien George f62d33aa1d Consolidate rt_make_function_[0123] to rt_make_function_n.
9 years ago
Damien George 2300537c79 Cleanup built-ins, and fix some compiler warnings/errors.
9 years ago
John R. Lenton 5c76839559 sorted
9 years ago
John R. Lenton 07205ec323 added zip()
9 years ago
John R. Lenton 13e64f0660 Merge remote-tracking branch 'upstream/master' into containment
9 years ago
Paul Sokolovsky 757ac81a69 Add proper checks for fits-in-small-int. Make it reusable.
9 years ago
Damien George c0876f7ca8 Merge pull request #146 from pfalcon/assert-exc
9 years ago
Paul Sokolovsky 729e9cce7b rt_binary_op(): Don't fall thru in case small_int op result doesn't fit back.
9 years ago
Paul Sokolovsky b81e1fdef7 Add AssertionError.
9 years ago
Damien George eae16445d5 py: Implement staticmethod and classmethod (internally).
9 years ago
John R. Lenton 813edf63a3 Merge remote-tracking branch 'upstream/master' into containment
9 years ago
John R. Lenton c1bef21920 Implemented support for `in` and `not in` operators.
9 years ago
Damien George bcbeea0a47 py: Fix bug where == and != not handled for small_ints.
9 years ago
John R. Lenton b8698fca75 unified the bops
9 years ago
Paul Sokolovsky bab5cfb34f Unsupported operand types for binary operator: dump both args' types.
9 years ago
Damien George 004cdcebfe py: Implement base class lookup, issubclass, isinstance.
9 years ago
Damien George 062478e66d Improved type/class/instance code; mp_obj_type_t now has load_attr, store_attr.
9 years ago
Damien George 93a9b5b64d py: Proper framework for built-in 'type'.
9 years ago
Damien George 6c73ca1e75 py: add variable argument exception constructor function.
9 years ago
Damien George 38a2da68c2 py: Stuff qstr in object pointer; keys for mp_map_t are now always mp_obj_t.
9 years ago