418 Commits (de5a9d72dcdaacdd5048195cd5bab007f4b2baef)

Author SHA1 Message Date
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
Damien George b97669ab94 py: Improve __build_class__.
9 years ago
John R. Lenton 9c83ec0eda Merge remote-tracking branch 'upstream/master' into dict_feats
9 years ago
John R. Lenton 88f3043e0a added a first pass of dict.update
9 years ago
Damien George 1a9951d5aa py: Fix up number operations and coercion.
9 years ago
Damien George 71c5181a8d Convert Python types to proper Python type hierarchy.
9 years ago
Damien George e9906ac3d7 Add ellipsis object.
9 years ago
Damien George eb7bfcb286 Split qstr into pools, and put initial pool in ROM.
9 years ago
Damien George 14f945c2ca Add note about implementing inplace operators.
9 years ago
Damien George 66028ab6dc Basic implementation of import.
9 years ago
Damien George 2870862601 Add module object, to be used eventually for import.
9 years ago
Damien George 40563d56bd py: Add framework for built-in "type()" function.
9 years ago
Damien George 209d1b1835 py: add int() and float() built-ins, partially implemented.
9 years ago
Damien George 6baf76e28b py: make closures work.
9 years ago
Damien George 8cc96a35e5 Put unicode functions in unicode.c, and tidy their names.
9 years ago
Damien dae7eb7226 py: add dict length function, and fix rt_store_set.
9 years ago
Damien b86e3f9293 py: implement some basic exception matching.
9 years ago
Damien d9d6201b52 py: simplify __next__ method for generators.
9 years ago
Damien d99b05282d Change object representation from 1 big union to individual structs.
9 years ago
Damien a3dcd9e80c py: add more Python built-in functions.
9 years ago
Damien 660365e14c py: split runtime into map, obj, builtin.
9 years ago
Damien 9ecbcfff99 py: work towards working closures.
9 years ago
Damien db4c361f1c py: add skeletal import functionality.
9 years ago
Damien 033d17a633 py: built-in range now accepts variable number of arguments.
9 years ago
Damien 86c7fc7dd9 py: add list pop and sort, unpack_sequence, and keywords in method_call.
9 years ago
Damien d47f9d5a4f py: add call to __init__ when instantiating class object.
9 years ago
Damien f03001f8a6 Add function to decode and show byte code.
9 years ago
Damien 0446a0d76d Change some debugging/output messages for native code generation.
9 years ago
Damien 6b92d451b2 Add len and subscr (a hack) support for strings.
9 years ago
Damien 5bf32c3b6b Built-in print function supports variable number of arguments.
9 years ago
Damien 40fdfe3000 Improve allocation of stack for byte code.
9 years ago
Damien 03c9cfb015 Make byte code jumps relative.
9 years ago
Damien 96a0addb18 Fixup include of stdarg and va_list definition.
9 years ago
Damien 2f06c57f8a Add simple var-arg functions; add simple string.format.
9 years ago
Damien 33af3bf028 Change Py API names, py_get_* -> py_obj_get_*.
9 years ago
Damien d57eba51e5 Add user object to runtime.
9 years ago
Damien 6ba1314265 Fix bug: emit native didn't clear last_was_return in label_assign.
9 years ago
Damien 7410e440ab Add basic complex number support.
9 years ago
Damien e0b1864337 Small hack to temporarily fix allocation of unique_code slots.
9 years ago
Damien ccfc9c51ba Py runtime: list.append returns None.
9 years ago
Damien 4ebb32fb95 Implement: str.join, more float support, ROT_TWO in VM.
9 years ago
Damien 2839168340 Add py_get_array_fixed_n function.
9 years ago
Damien 6f08f8ce51 Add working MMA support.
9 years ago
Damien 8b3a7c2237 Fix func decls with no arguments: () -> (void).
9 years ago
Damien 9fc7933ff2 Add py_get_qstr.
9 years ago
Damien ec63cce470 Add simple support for C modules.
9 years ago
Damien 7b2d3f38ce Implement some more operators, mostly for small ints.
9 years ago
Damien f086ecf57c Shrink py_obj_base_t size to 4 machine words.
9 years ago
Damien df4b4f31ef Make grammar rules const so the go in .text section.
9 years ago
Damien 1595f3257e Make rt_fun_table const, so it goes in .text section.
9 years ago
Damien 5ac1b2efbd Implement REPL.
9 years ago
Damien d2755ec538 Add iterators and comprehension to emitnative.
9 years ago
Damien c12aa468a1 Add SET_ADD opcode to VM.
9 years ago
Damien bd25445a82 Implement BC & runtime support for generator/yielding.
9 years ago
Damien c226dca1f7 Support tuples and list comprehension, albeit crude.
9 years ago
Damien ce89a21ea4 Implement basic exception framework, and simple for loop.
9 years ago
Damien 3ef4abb446 Change ifdef/if defined to simple if's.
9 years ago
Damien c025ebb2dc Separate out mpy core and unix version.
9 years ago
Damien a1ddfcc213 Wrap out-native code in preprocessor declarations.
9 years ago
Damien eb19efb27e Simplify and improve function & method calling.
9 years ago
Damien 7f5dacf345 Implement basic class/object in native code.
9 years ago
Damien a397776d6b Implement basic class/object functionality in runtime.
9 years ago
Damien 13ed3a658d Native Python and Viper support for x64 and thumb all together.
9 years ago
Damien e4af64f307 Functions to convert values to/from inline asm.
9 years ago
Damien dc83382903 Make runtime able to call inline asm with 1 argument.
9 years ago
Damien 826005c60b Add support for inline thumb assembly.
9 years ago
Damien 6cdd3af601 Implement built-in decorators to select emit type.
9 years ago
Damien b05d707b23 Further factorise PASS_1 out of specific emit code.
9 years ago
Damien 429d71943d Initial commit.
9 years ago