summaryrefslogtreecommitdiffstatshomepage
path: root/py
Commit message (Collapse)AuthorAge
* Update mkrules.mkAndrew Scheller2014-04-11
| | | make 'make clean' cleaner ;-)
* py: Add simple way of looking up constants in compiler.Damien George2014-04-10
| | | | | | | | | | | | Working towards trying to support compile-time constants (see discussion in issue #227), this patch allows the compiler to look inside arbitrary uPy objects at compile time. The objects to search are given by the macro MICROPY_EXTRA_CONSTANTS (so they must be constant/ROM objects), and the constant folding occures on forms base.attr (both base and attr must be id's). It works, but it breaks strict CPython compatibility, since the lookup will succeed even without importing the namespace.
* py: Fix float/complex binop returning NULL; implement complex power.Damien George2014-04-10
|
* py: Simplify stack get/set to become stack adjust in emitters.Damien George2014-04-10
| | | | Can do this now that the stack size calculation is improved.
* py, compiler: Improve stack depth counting.Damien George2014-04-10
| | | | Much less of a hack now. Hopefully it's correct!
* py: Make sure state/stack of byte code function has at least 1 slot.Damien George2014-04-10
|
* py: Fix VM stack overflow detection.Damien George2014-04-10
|
* py: Add option to VM to detect stack overflow.Damien George2014-04-10
|
* py: Add missing dummy functions to pass 1 emitter.Damien George2014-04-10
|
* py: Check explicitly for memory allocation failure in parser.Damien George2014-04-10
| | | | | | Previously, a failed malloc/realloc would throw an exception, which was not caught. I think it's better to keep the parser free from NLR (exception throwing), hence this patch.
* Make lexerunix not allocate RAM for the entire script.Damien George2014-04-10
| | | | Now reads in small chunks at a time.
* py: Add emergency exception object for when heap allocation fails.Damien George2014-04-10
|
* py: Make labels unsigned ints (converted from int).Damien George2014-04-10
| | | | | Labels should never be negative, and this modified type signature reflects that.
* py: Fix modstruct to compile on 64-bit machine.Damien George2014-04-10
|
* Merge branch 'master' of github.com:micropython/micropythonDamien George2014-04-10
|\
| * objfun: Fix default arguments filling loop, was broken in presense of kwargs.Paul Sokolovsky2014-04-10
| |
| * objfun: More debug logging when calling a bytecode function.Paul Sokolovsky2014-04-10
| |
| * py: Start implementing "struct" module.Paul Sokolovsky2014-04-10
| | | | | | | | | | | | | | | | | | Only calcsize() and unpack() functions provided so far, for little-endian byte order. Format strings don't support repition spec (like "2b3i"). Unfortunately, dealing with all the various binary type sizes and alignments will lead to quite a bloated "binary" helper functions - if optimizing for speed. Need to think if using dynamic parametrized algos makes more sense.
| * makeqstrdata.py: Add support for conditionally defined qstrs.Paul Sokolovsky2014-04-10
| | | | | | | | Syntax is usual C #if*/#endif, but each qstr must be wrapped individually.
| * objstr: Add TODO-optimize for using .join with arbitrary iterable.Paul Sokolovsky2014-04-10
| |
* | py, compiler: Implement compiling of relative imports.Damien George2014-04-10
| |
* | py: Fix lexer so it doesn't allow ! and ..Damien George2014-04-10
| |
* | py: Make form-feed character a space (following C isspace).Damien George2014-04-10
| | | | | | | | Eg, in CPython stdlib, email/header.py has a form-feed character.
* | py, lexer: Fix parsing of raw strings (allow escaping of quote).Damien George2014-04-10
|/
* Merge pull request #455 from lurch/exception-messagesDamien George2014-04-09
|\ | | | | Remove exception name from inside the exception message
| * Remove exception name from inside the exception messageAndrew Scheller2014-04-09
| | | | | | | | | | This prevents micropython printing exception messages like ImportError: ImportError: No module named 'foo'
* | Merge branch 'str-index' of github.com:xbe/micropython into xbe-str-indexDamien George2014-04-09
|\ \
| * | py: Implement str.[r]index() and add tests for them.xbe2014-04-08
| | |
| * | py: Update comment in str.replace().xbe2014-04-08
| | |
* | | py: Implement complex division.Damien George2014-04-09
| | |
* | | py: Oops, fix emitcpy to compile with latest changes.Damien George2014-04-09
| | |
* | | py: Add mp_obj_is_integer; make mp_get_index check for long int.Damien George2014-04-09
| | | | | | | | | | | | | | | mp_obj_is_integer should be used to check if an object is of integral type. It returns true for bool, small int and long int.
* | | py: Clear state to MP_OBJ_NULL before executing byte code.Damien George2014-04-09
| | |
* | | py: str.join can now take arbitrary iterable as argument.Damien George2014-04-09
| | |
* | | py: Generators can have their locals closed over.Damien George2014-04-09
| |/ |/|
* | py: Properly implement deletion of locals and derefs, and detect errors.Damien George2014-04-09
| | | | | | | | | | Needed to reinstate 2 delete opcodes, to specifically check that a local is not deleted twice.
* | py, compiler: Turn id_info_t.param into a set of flags.Damien George2014-04-09
| | | | | | | | So we can add more flags.
* | py, compile: Simplify initialisation of compiler structure.Damien George2014-04-09
| |
* | py, compile: Reduce size of compiler structure.Damien George2014-04-09
| |
* | py, compile: Combine have_star_arg, have_dbl_star_arg into star_flags.Damien George2014-04-09
| | | | | | | | Small reduction in ROM, heap and stack usage.
* | py, compiler: Clean up and compress scope/compile structures.Damien George2014-04-09
| | | | | | | | | | Convert int types to uint where sensible, and then to uint8_t or uint16_t where possible to reduce RAM usage.
* | gc.c: Remove superfluous typedef (bute defined in misc.h).Paul Sokolovsky2014-04-09
| |
* | py: Make it so that printing a small int does not allocate heap memory.Damien George2014-04-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | With the implementation of proper string formatting, code to print a small int was delegated to mpz_as_str_inpl (after first converting the small int to an mpz using stack memory). But mpz_as_str_inpl allocates heap memory to do the conversion, so small ints needed heap memory just to be printed. This fix has a separate function to print small ints, which does not allocate heap, and allocates less stack. String formatting, printf and pfenv are now large beasts, with some semi-duplicated code.
* | Merge branch 'master' of github.com:micropython/micropythonDamien George2014-04-08
|\ \
| * | objint: Implement int.from_bytes() class method and .to_bytes() method.Paul Sokolovsky2014-04-09
| | | | | | | | | | | | | | | | | | | | | These two are apprerently the most concise and efficient way to convert int to/from bytes in Python. The alternatives are struct and array modules, but methods using them are more verbose in Python code and less efficient in memory/cycles.
| * | py: Add mp_get_buffer(), mp_get_buffer_raise() convenience functions to API.Paul Sokolovsky2014-04-09
| | |
* | | py: Add comment mpz function, and free memory used for string printing.Damien George2014-04-08
|/ /
* | py: Reinstate old pfenv_print_int function for stmhal's printf.Damien George2014-04-08
| |
* | py: Remove obsolete mp_delete_subscr declaration.Damien George2014-04-08
| |
* | py: Remove DELETE_SUBSCR opcode, combine with STORE_SUBSCR.Damien George2014-04-08
| | | | | | | | | | This makes the runtime and object APIs more consistent. mp_store_subscr functionality now moved into objects (ie list and dict store_item).