aboutsummaryrefslogtreecommitdiff
path: root/py
AgeCommit message (Collapse)Author
2014-01-24Revert "Move gc_collect to py/gc.c"Damien George
This reverts commit a215b09c0dc29b82161092e92ea2e5e004d79468.
2014-01-24Merge pull request #218 from iabdalkader/masterDamien George
Move file obj to separate module
2014-01-24py: Improve freeing of emitters in mp_compile.Damien George
There can be multiple emitters allocated during compile (eg byte code and native).
2014-01-24Merge pull request #217 from pfalcon/free-emitterDamien George
Add support for freeing code emitter objects at the end of compilation.
2014-01-24Retain file order of qstr definitions.Damien George
Want common qstrs to be first in the list so they have the lowest ids, so that in the byte code they take up the least room.
2014-01-24Merge pull request #215 from pfalcon/qstr-special-charsDamien George
Allow qstr's with non-ident chars, construct good identifier for them.
2014-01-24Move gc_collect to py/gc.cmux
* Move gc_collect from main to py/gc.c * Define GC's memory boundaries in linker script * Issue #220
2014-01-24Add support for freeing code emitter objects at the end of compilation.Paul Sokolovsky
2014-01-24lexerstr: Free mp_lexer_str_buf_t structure itself.Paul Sokolovsky
2014-01-24Allow qstr's with non-ident chars, construct good identifier for them.Paul Sokolovsky
Also, add qstr's for string appearing in unix REPL loop, gross effect being less allocations for each command run.
2014-01-23mp_compile(): Properly free module_scope and all nested scopes.Paul Sokolovsky
2014-01-23mp_lexer_free(): Free lex->indent_level array.Paul Sokolovsky
2014-01-23py: Implement bool unary op; tidy up unary op dispatch.Damien George
2014-01-23py: Simpler implementation of mp_obj_callable.Damien George
2014-01-23mp_obj_is_callable(): Only object types can be callable.Paul Sokolovsky
Fixes segfault on callable("string").
2014-01-23Implement simplest case of str.startswith().Paul Sokolovsky
2014-01-23py: Use C99 way of variable macro arguments.Damien George
Addresses Issue #207.
2014-01-23py: Change macro var args in parser to be C99 compliant.Damien George
2014-01-22py: Initialise loaded_module map in rt_init.Damien George
STM port crashes without this re-init. There should not be any state in the core py/ code that relies on pre-initialised data.
2014-01-22Fix 1 warning and 1 bug.Damien George
2014-01-22Implement octal and hex escapes in strings.Paul Sokolovsky
2014-01-22file.readline(): Use mp_obj_str_get_data() and fix off-by-one error on EOF.Paul Sokolovsky
2014-01-22Second stage of qstr revamp: uPy str object can be qstr or not.Damien George
2014-01-22py: Remove implicit conversion of float to int in mp_obj_get_int().Damien George
Addresses Issue #199.
2014-01-21Merge branch 'master' of github.com:micropython/micropythonDamien George
2014-01-21py: Implement break and continue byte codes, and add tests.Damien George
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).
2014-01-21Fix malformed generated file when using python 2.7Dave Hylands
2014-01-21array: Implement iterator.Paul Sokolovsky
2014-01-21Add len() support for arrays.Paul Sokolovsky
2014-01-21Merge branch 'master' of github.com:micropython/micropythonDamien George
Conflicts: py/objstr.c py/py.mk py/stream.c unix/main.c unix/socket.c
2014-01-21Revamp qstrs: they now include length and hash.Damien George
Can now have null bytes in strings. Can define ROM qstrs per port using qstrdefsport.h
2014-01-21Implement str.split(None).Paul Sokolovsky
Note that splitting by explicit string is not implemented so far.
2014-01-21str: Implement proper string (instead of byte string) indexing.Paul Sokolovsky
Also, support negative indexes.
2014-01-21Implement string multiplication.Paul Sokolovsky
2014-01-21sequence.c: Start to refactor sequence operations for reuse among types.Paul Sokolovsky
2014-01-20objstr: More support for MP_OBJ_QSTR.Paul Sokolovsky
2014-01-20mp_obj_get_type_str(): Handle MP_OBJ_QSTR.Paul Sokolovsky
2014-01-20Add dummy bytes() constructor.Paul Sokolovsky
Currently, MicroPython strings are mix between CPython byte and unicode strings. So, conversion is null so far. This dummy implementation is intended for compatibility with CPython (so, same code can run on both).
2014-01-20stream_read(): Shrink memory block to actual read size.Paul Sokolovsky
2014-01-20stream: Add generic unbuffered iternext method.Paul Sokolovsky
Uses stream_unbuffered_readline underline.
2014-01-20mp_identity(): Add generic identity function.Paul Sokolovsky
Useful as getiter method for objects which are their own iterators, etc.
2014-01-20mp_obj_get_qstr(): Handle MP_OBJ_QSTR.Paul Sokolovsky
2014-01-20py: Put micropython module init code in builtinmp.c.Damien George
2014-01-20Expose memory stats functions via "micropython" module.Paul Sokolovsky
These are micropython.mem_total(), .mem_current(), .mem_peak(). These are 3 individual functions with simple scalar return value to make sure that calls to these functions themselves have minimal (hopefully zero) impact on memory allocation.
2014-01-20Don't implicitly import "sys" module.Paul Sokolovsky
2014-01-20Pre-create sys module.Paul Sokolovsky
2014-01-20Properly print MP_OBJ_QSTR objects.Paul Sokolovsky
2014-01-20Implement modules as singletons Python semantics.Paul Sokolovsky
In Python, importing module several times returns same underlying module object. This also fixes import statement handling for builtin modules. There're still issues: 1. CPython exposes set of loaded modules as sys.modules, we may want to do that either. 2. Builtin modules are implicitly imported, which is not really correct. We should separate registering a (builtin) module and importing a module. CPython keeps builtin module names in sys.builtin_module_names .
2014-01-19Change int to uint for n_args in function with variable arguments.Damien George
2014-01-19py: Add full traceback to exception printing.Damien George