John R. Lenton
be8fe5be2e
Added dict.setdefault
11 years ago
John R. Lenton
f77dce8a5d
Added dict.popitem
11 years ago
John R. Lenton
0fcbaa442f
implemented dict.pop
11 years ago
John R. Lenton
cd0887352d
Added dict.get.
11 years ago
John R. Lenton
d90b19eca5
Added dict.copy
11 years ago
John R. Lenton
7d21d516d2
make dict_len use the map's used count
11 years ago
John R. Lenton
4ce6ceadca
Added dict.clear.
Added 0 to the list of primes. Funky primes, these.
11 years ago
John R. Lenton
a41fe31322
Added dict iterator.
11 years ago
Paul Sokolovsky
24507aff7d
Typo fix in comment.
11 years ago
Paul Sokolovsky
af61a1a492
Use constructor to create small int (avoid exposing mp_obj_t internals to VM).
11 years ago
John R. Lenton
c553162ebc
Fix off-by-one in non-default values of index's 2nd and 3rd arguments.
11 years ago
Paul Sokolovsky
860ffb0a43
Convert many object types structs to use C99 tagged initializer syntax.
11 years ago
Dave Hylands
d986b582c0
Make qstr_init reinitialize last_pool.
This causes the pool to get reinitialized properly on a soft-reset.
11 years ago
Damien George
f0691f4ed5
Fix qstr in objlist.c; add more tests for list.index.
list.index fails on an edge case.
11 years ago
xyb
8cfc9f07b9
Implements str iterator
11 years ago
Damien George
45b43c21c4
Oops: add objint.c
11 years ago
Damien George
71c5181a8d
Convert Python types to proper Python type hierarchy.
Now much more inline with how CPython does types.
11 years ago
Mikael Eiman
d67091371d
OSX: fixes to make nlrx64.S with Apple's clang (switched to Apple-specific define instead of __llvm__)
11 years ago
Mikael Eiman
f53cdd947c
OSX: fixes to make nlrx64.S with Apple's clang (forgot a few places)
11 years ago
Mikael Eiman
5d02e2d6fa
OSX: fixes to make nlrx64.S with Apple's clang
11 years ago
Damien George
e9906ac3d7
Add ellipsis object.
11 years ago
Damien George
eb7bfcb286
Split qstr into pools, and put initial pool in ROM.
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).
11 years ago
Damien George
e67ed5d285
Improve configurability for native x64/thumb emitter.
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.
11 years ago
John R. Lenton
6e1e98f864
Implements list.reverse; fixes issue #66
11 years ago
John R. Lenton
49fb6e53b3
Implements list.remove (in terms of list.index and list.pop).
Fixes issue #63 .
11 years ago
Paul Sokolovsky
6ee1e383d6
str slice: Trim slice indexes to be in range.
11 years ago
John R. Lenton
45a8744617
Implements list.insert. Fixes issue #61 .
11 years ago
Damien George
c8d1384fc0
Fix int -> machine_int_t; add print to slice test.
11 years ago
Paul Sokolovsky
f8b9d3c41a
str: Throw TypeError for invalid index type and clean up comments.
11 years ago
Paul Sokolovsky
e606cb6561
slice: Allow building with MICROPY_ENABLE_SLICE=0.
11 years ago
Paul Sokolovsky
decad08ef5
str: Handle non-positive slice indexes.
11 years ago
Paul Sokolovsky
59800afae9
slice: Implement special handling of omitted start/stop indexes.
11 years ago
Paul Sokolovsky
cd22627f78
Enable slice support in config.
11 years ago
Paul Sokolovsky
31ba60f836
str: Initial implementation of string slicing.
Only step=1 and non-negative indexes are supported so far.
11 years ago
Paul Sokolovsky
ded0a1efa5
Implement BUILD_SLICE opcode (2-arg version).
11 years ago
Paul Sokolovsky
1c6de11f77
Add basic implementation of slice object.
So far, only start and stop integer indexes are supported. Step is
not supported, as well as objects of arbitrary types.
11 years ago
John R. Lenton
5d4a821339
Implements list.index. Fixes issue #57 .
11 years ago
John R. Lenton
e241e8c169
Implemented list.count
11 years ago
Paul Sokolovsky
c90c0f68a2
Move INT_FMT, etc. declaration into global mpconfig.h .
This in particular makes it available for stm port.
11 years ago
John R. Lenton
26c211648b
Implemented list.copy. Fixes issue #54 .
11 years ago
John R. Lenton
069ded9514
Added list.clear. Fixes issue #53 .
11 years ago
John R. Lenton
25f417c08c
Worked on list.pop:
* Fixes issue #51
* Adds a specific error message for when you try to pop an empty list.
* Releases some memory if the list has shurnk a lot.
11 years ago
Paul Sokolovsky
b372bfca21
Rename default config file to mpconfig.h, and port's to mpconfigport.h.
mpconfig.h will automatically pull mpconfigport.h.
11 years ago
Paul Sokolovsky
ef18102b9e
Make it possible to turn off collecting memory stats (MICROPY_MEM_STATS).
11 years ago
Paul Sokolovsky
780f555b2e
Add new alloc metric: peak_bytes_allocated.
This is just max value of current_bytes_allocated seen.
11 years ago
Paul Sokolovsky
02de0c57d2
Add new alloc metric: current_bytes_allocated.
Unlike total_bytes_allocated, this tracks m_free()'s too.
11 years ago
Paul Sokolovsky
43f1c8080a
m_realloc: Account only allocation size difference in total_bytes_allocated.
11 years ago
Damien George
1fb031744f
Change mp_compile so that it returns a function object for the module.
11 years ago
Damien George
14f945c2ca
Add note about implementing inplace operators.
11 years ago
Damien George
66028ab6dc
Basic implementation of import.
import works for simple cases. Still work to do on finding the right
script, and setting globals/locals correctly when running an imported
function.
11 years ago