summaryrefslogtreecommitdiffstatshomepage
path: root/py/compile.c
Commit message (Collapse)AuthorAge
* py: Fix bug in optimised for .. range.Damien George2014-03-31
| | | | | | Don't store final, failing value to the loop variable. This fix also makes for .. range a bit more efficient, as it uses less store/load pairs for the loop variable.
* py: Towards default keyword arguments.Damien George2014-03-31
| | | | These are default arguments after a bare *.
* Merge branch 'master' of github.com:micropython/micropythonDamien George2014-03-31
|\
| * compile: Don't try to constant-fold division by zero.Paul Sokolovsky2014-03-31
| | | | | | | | | | The way it is, just crashes app. And optimizing to "raise ZeroDivisionError" is probably too much.
* | py: Rename and reorder parameters in emit_make_function/closure.Damien George2014-03-31
|/ | | | In preparation for implementing default keyword arguments.
* py: Fix bug in compiler for empty class bases.Damien George2014-03-30
| | | | Eg class A(): pass would fail an assertion.
* Rename rt_* to mp_*.Damien George2014-03-30
| | | | | | | Mostly just a global search and replace. Except rt_is_true which becomes mp_obj_is_true. Still would like to tidy up some of the names, but this will do for now.
* compile: Print error messages on unimplemented relative imports.Paul Sokolovsky2014-03-30
|
* Merge pull request #389 from pfalcon/with-statementDamien George2014-03-29
|\ | | | | With statement implementation
| * vm: Implement "with" statement (SETUP_WITH and WITH_CLEANUP bytecodes).Paul Sokolovsky2014-03-29
| |
* | py: Free unique_code slot for outer module.Damien George2014-03-29
|/ | | | | | Partly (very partly!) addresses issue #386. Most importantly, at the REPL command line, each invocation does not now lead to increased memory usage (unless you define a function/lambda).
* py: Factor out code from runtime.c to emitglue.c.Damien George2014-03-27
|
* py: Calculate maximum exception stack size in compiler.Damien George2014-03-27
|
* py: Restore CPython compatibility in compiler for closures with def args.Damien George2014-03-26
|
* py: Support closures with default args.Paul Sokolovsky2014-03-26
|
* Fixed floor division on mp ints and small ints. Added a floordivide test case.Rachel Dowdall2014-03-22
|
* Fixed modulo operator on ints and mp ints to agree with python. Added ↵Rachel Dowdall2014-03-22
| | | | intdivmod.c and tests/basics/modulo.py.
* py: Clean up includes.xbe2014-03-17
| | | | Remove unnecessary includes. Add includes that improve portability.
* py: Unify syntax error handling in compiler; check defualt arg syntax.Damien George2014-03-03
| | | | | Checks for non-default args following default args, and errors out. Addresses issue #328.
* py: Remove name of var arg from macros with var args.Damien George2014-02-26
|
* parse: Refactor parse node encoding to support full range of small ints.Paul Sokolovsky2014-02-22
| | | | | Based on suggestion by @dpgeorge at https://github.com/micropython/micropython/pull/313
* parse: Note that fact that parser's small ints are different than VM small int.Paul Sokolovsky2014-02-21
| | | | | | Specifically, VM's small ints are 31 bit, while parser's only 28. There's already MP_OBJ_FITS_SMALL_INT(), so, for clarity, rename MP_FIT_SMALL_INT() to MP_PARSE_FITS_SMALL_INT().
* compile: Add comments ergarding non-implemented relative imports.Paul Sokolovsky2014-02-20
|
* py: Pass all scope flags through to runtime.Damien George2014-02-15
|
* Replace global "static" -> "STATIC", to allow "analysis builds". Part 2.Paul Sokolovsky2014-02-12
|
* Clean up handling of function return type annotation.Paul Sokolovsky2014-02-10
|
* py: Fix compile of class with keyword arguments in bases.Damien George2014-02-06
|
* py: Add built-in super.Damien George2014-02-05
|
* py: Tidy up BINARY_OPs; negation done by special NOT bytecode.Damien George2014-02-01
| | | | | IS_NOT and NOT_IN are now compiled to IS + NOT and IN + NOT, with a new special NOT bytecode.
* py: Reduce code size of compiler by a bit.Damien George2014-02-01
|
* py: Implement break/continue from an exception with finally.Damien George2014-02-01
| | | | Still todo: break/continue from within the finally block itself.
* Implement default function arguments (for Python functions).Paul Sokolovsky2014-02-01
| | | | | | | | TODO: Decide if we really need separate bytecode for creating functions with default arguments - we would need same for closures, then there're keywords arguments too. Having all combinations is a small exponential explosion, likely we need just 2 cases - simplest (no defaults, no kw), and full - defaults & kw.
* py: Fix bug with LOAD_METHOD; fix int->machine_int_t for small int.Damien George2014-01-29
| | | | | | | | LOAD_METHOD bug was: emitbc did not correctly calculate the amount of stack usage for a LOAD_METHOD operation. small int bug was: int was being used to pass small ints, when it should have been machine_int_t.
* py: Implement 'not' in compiler, and improve rt_is_true.Damien George2014-01-28
|
* py: Improve freeing of emitters in mp_compile.Damien George2014-01-24
| | | | | There can be multiple emitters allocated during compile (eg byte code and native).
* Add support for freeing code emitter objects at the end of compilation.Paul Sokolovsky2014-01-24
|
* mp_compile(): Properly free module_scope and all nested scopes.Paul Sokolovsky2014-01-23
|
* py: Use C99 way of variable macro arguments.Damien George2014-01-23
| | | | Addresses Issue #207.
* py: Change macro var args in parser to be C99 compliant.Damien George2014-01-23
|
* py: Implement break and continue byte codes, and add tests.Damien George2014-01-21
| | | | | | | Also fixes a bug in the for-in-range optimiser. I hope to remove break and continue byte codes in the future and just use jump (if possible).
* Revamp qstrs: they now include length and hash.Damien George2014-01-21
| | | | | Can now have null bytes in strings. Can define ROM qstrs per port using qstrdefsport.h
* py: Add module/function/class name to exceptions.Damien George2014-01-19
| | | | | | | Exceptions know source file, line and block name. Also tidy up some debug printing functions and provide a global flag to enable/disable them.
* Add source file name and line number to error messages.Damien George2014-01-18
| | | | | Byte code has a map from byte-code offset to source-code line number, used to give better error messages.
* Implement eval.Damien George2014-01-15
|
* py: AssertionError is loaded from global, to match CPython.Damien George2014-01-12
|
* unified the bopsJohn R. Lenton2014-01-11
|
* compile_for_stmt_optimised_range(): Properly handle negative & unknown steps.Paul Sokolovsky2014-01-11
| | | | | If step is not constant, in first approximation, we can't apply optimization, (well, we could, but need a special case for this).
* Convert Python types to proper Python type hierarchy.Damien George2014-01-04
| | | | Now much more inline with how CPython does types.
* Split qstr into pools, and put initial pool in ROM.Damien George2014-01-04
| | | | | | | | | | | | | | | | Qstr's are now split into a linked-list of qstr pools. This has 2 benefits: the first pool can be in ROM (huge benefit, since we no longer use RAM for the core qstrs), and subsequent pools use m_new for the next pool instead of m_renew (thus avoiding a huge single table for all the qstrs). Still would be better to use a hash table, but this scheme takes us part of the way (eventually convert the pools to hash tables). Also fixed bug with import. Also improved the way the module code is referenced (not magic number 1 anymore).
* Improve configurability for native x64/thumb emitter.Damien George2014-01-04
| | | | | | With MICROPY_EMIT_X64 and MICROPY_EMIT_THUMB disabled, the respective emitters and assemblers will not be included in the code. This can significantly reduce binary size for unix version.