summaryrefslogtreecommitdiffstatshomepage
path: root/py
Commit message (Collapse)AuthorAge
* py: Compress a little the bytecode emitter structure.Damien George2014-05-10
|
* py, emitters: Fix dummy_data size for bytecode and thumb.Damien George2014-05-10
| | | | | | | Thumb uses a bit less RAM, bytecode uses a tiny bit more, to avoid overflow of the dummy buffer in certain cases. Addresses issue #599.
* Merge branch 'master' of github.com:micropython/micropythonDamien George2014-05-10
|\
| * objstr: Implement .lower() and .upper().Paul Sokolovsky2014-05-10
| |
* | py, lexer: Add allocation policy config; return NULL if can't allocate.Damien George2014-05-10
|/
* py: Improve handling of memory error in parser.Damien George2014-05-10
| | | | | | | | | | | Parser shouldn't raise exceptions, so needs to check when memory allocation fails. This patch does that for the initial set up of the parser state. Also, we now put the parser object on the stack. It's small enough to go there instead of on the heap. This partially addresses issue #558.
* builtinimport: Fix broken namespace imports due to dup vstr_cut_tail_bytes().Paul Sokolovsky2014-05-10
|
* builtinimport: Fix comment orphaned by one of previous commits.Paul Sokolovsky2014-05-10
|
* modsys: Enable sys.exit() per port after all.Paul Sokolovsky2014-05-10
|
* modsys, unix: Add sys.exit(), should be implemented by a port.Paul Sokolovsky2014-05-10
|
* py: Disable frozenset by default, enable on unix.Paul Sokolovsky2014-05-10
| | | | Takes 416 text bytes on x86.
* objset: Give up and implement frozenset.Paul Sokolovsky2014-05-10
| | | | Tired of patching CPython stdlib for it.
* objtype: Don't treat inheritance from "object" as from native type.Paul Sokolovsky2014-05-10
| | | | | | | | | | | "object" type in MicroPython currently doesn't implement any methods, and hopefully, we'll try to stay like that for as long as possible. Even if we have to add something eventually, look up from there might be handled in adhoc manner, as last resort (that's not compliant with Python3 MRO, but we're already non-compliant). Hence: 1) no need to spend type trying to lookup anything in object; 2) no need to allocate subobject when explicitly inheriting from object; 3) and having multiple bases inheriting from object is not a case of incompatible multiple inheritance.
* py: Tidy up returning NULL which should be MP_OBJ_NOT_SUPPORTED.Damien George2014-05-10
|
* py: Combine native emitters to 1 glue function; distinguish viper.Damien George2014-05-10
| | | | | | | | This patch simplifies the glue between native emitter and runtime, and handles viper code like inline assember: return values are converted to Python objects. Fixes issue #531.
* py: Rename byte_code to bytecode everywhere.Damien George2014-05-10
| | | | bytecode is the more widely used. See issue #590.
* py: Fix base "detection" for int('0<hexdigit>', 16).Paul Sokolovsky2014-05-10
|
* bytes: Implement comparison and other binary operations.Paul Sokolovsky2014-05-10
| | | | Should support everything supported by strings.
* runtime0.h: Group binary ops by fives.Paul Sokolovsky2014-05-10
| | | | So one has some chance to convert numeric op code into symbol.
* windows: Add modtime implementationstijn2014-05-09
|
* Add gc.enable, gc.disable; remove pyb.gc.Damien George2014-05-08
|
* Merge pull request #568 from stinos/windows-msvc-portPaul Sokolovsky2014-05-09
|\ | | | | Windows MS Visual C port
| * Windows MSVC portstijn2014-05-08
| | | | | | | | Extend the windows port so it compiles with the toolchain from Visual Studio 2013
* | py, compiler: Add basic support for A=const(123).Damien George2014-05-08
|/ | | | | | | | | | | You can now do: X = const(123) Y = const(456 + X) and the compiler will replace X and Y with their values. See discussion in issue #266 and issue #573.
* py: Fix stack access in thumb native emitter.Damien George2014-05-07
|
* py: Fix emitcpy, to work with latest changes to PASS variables.Damien George2014-05-07
|
* py: Improve native emitter; now supports more opcodes.Damien George2014-05-07
|
* py, compiler: Improve passes; add an extra pass for native emitter.Damien George2014-05-07
|
* py, compiler: Start adding support for compile-time constants.Damien George2014-05-07
| | | | Just a start, no working code yet. As per issue #573.
* stream: Make non-blcoking stream support configurable.Paul Sokolovsky2014-05-07
| | | | Enable only on unix. To avoid unpleasant surprises with error codes.
* stream: Use standard name of DEFAULT_BUFFER_SIZE.Paul Sokolovsky2014-05-07
|
* stream: Add compliant handling of non-blocking readall().Paul Sokolovsky2014-05-07
|
* stream: Add compliant handling of non-blocking read()/write().Paul Sokolovsky2014-05-07
| | | | | | | | | | | In case of empty non-blocking read()/write(), both return None. read() cannot return 0, as that means EOF, so returns another value, and then write() just follows. This is still pretty unexpected, and typical "if not len:" check would treat this as EOF. Well, non-blocking files require special handling! This also kind of makes it depending on POSIX, but well, anything else should emulate POSIX anyway ;-).
* py, parser: Add commented-out code to discard doc strings.Damien George2014-05-06
| | | | | | Doesn't help with RAM reduction because doc strings are interned as soon as they are encountered, which is too soon to do any optimisations on them.
* Merge branch 'master' of https://github.com/micropython/micropythonDamien George2014-05-06
|\ | | | | | | | | | | | | Conflicts: py/argcheck.c py/objenumerate.c py/runtime.h
| * py: bytes(), str(): Add NotImplementedError for kwargs.Paul Sokolovsky2014-05-06
| | | | | | | | Addresses #567.
| * py: enumerate(): Add NotImplementedError for kwargs.Paul Sokolovsky2014-05-06
| | | | | | | | Addresses #577.
* | py: Add keyword arg support to enumerate constructor.Damien George2014-05-06
|/ | | | | | | | Need to have a policy as to how far we go adding keyword support to built ins. It's nice to have, and gets better CPython compatibility, but hurts the micro nature of uPy. Addresses issue #577.
* modgc: Add new module for GC-related functionality.Paul Sokolovsky2014-05-06
|
* py: Comment exc_state member from mp_obj_gen_instance_t as it gives troublestijn2014-05-05
| | | | | | | ...to some compilers who can't process 2 zero-sized arrays in structs. It's never referenced directly anyway. See disussion on #568 as well.
* py-version.sh: Use --always option of git describe.Paul Sokolovsky2014-05-05
|
* py: Turn down amount of RAM parser and compiler use.Damien George2014-05-05
| | | | | | | | | | | | | | | | | | | | | | | | There are 2 locations in parser, and 1 in compiler, where memory allocation is not precise. In the parser it's the rule stack and result stack, in the compiler it's the array for the identifiers in the current scope. All other mallocs are exact (ie they don't allocate more than is needed). This patch adds tuning options (MP_ALLOC_*) to mpconfig.h for these 3 inexact allocations. The inexact allocations in the parser should actually be close to logarithmic: you need an exponentially larger script (absent pathological cases) to use up more room on the rule and result stacks. As such, the default allocation policy for these is now to start with a modest sized stack, but grow only in small increments. For the identifier arrays in the compiler, these now start out quite small (4 entries, since most functions don't have that many ids), and grow incrementally by 6 (since if you have more ids than 4, you probably have quite a few more, but it wouldn't be exponentially more). Partially addresses issue #560.
* py-version.sh: Make it work in case no git tag is present.Paul Sokolovsky2014-05-05
|
* py, unix: Add -v option, print bytecode dump if used.Paul Sokolovsky2014-05-05
| | | | | | | | | | This will work if MICROPY_DEBUG_PRINTERS is defined, which is only for unix/windows ports. This makes it convenient to user uPy normally, but easily get bytecode dump on the spot if needed, without constant recompiles back and forth. TODO: Add more useful debug output, adjust verbosity level on which specifically bytecode dump happens.
* showbc: Quote block name, so it was easily visible.Paul Sokolovsky2014-05-04
|
* Add license header to (almost) all files.Damien George2014-05-03
| | | | | | | Blanket wide to all .c and .h files. Some files originating from ST are difficult to deal with (license wise) so it was left out of those. Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
* Merge pull request #535 from pfalcon/blurbDamien George2014-05-03
|\ | | | | Proposed license/copyright file header.
| * py: Add copyright/license header to each file.Paul Sokolovsky2014-05-01
| |
* | Merge branch 'mingw-float-printf' of github.com:stinos/micropython into ↵Damien George2014-05-03
|\ \ | | | | | | | | | stinos-mingw-float-printf
| * | mingw: Fix number of exponent digits in floating point formattingstijn2014-05-03
| | | | | | | | | | | | | | | | | | | | | By default mingw outputs 3 digits instead of the standard 2 so all float tests using printf fail. Using setenv at the start of the program fixes this. To accomodate calling platform specific initialization a MICROPY_MAIN_INIT_FUNC macro is used which is called in mp_init()