Paul Sokolovsky
e99841be69
mp_obj_get_int(): Add warning against adding implicit float->int conversion.
11 years ago
mux
cc849f70f4
Move del to locals
11 years ago
Damien George
09a4d8305d
py: Fix bug in DELETE_SUBSCR bytecode, decreasing sp too much.
11 years ago
Damien George
b6ec51bbf0
tests: Add test for dict delete. It fails.
11 years ago
Damien George
66edc5d899
py: Implement DELETE_SUBSCR bytecode; implement mp_obj_dict_delete.
11 years ago
Damien George
3c8aecf62c
Merge pull request #431 from pfalcon/unbreak-map-remove
map: When removing a key, don't NULL the entry, but mark as deleted.
11 years ago
Paul Sokolovsky
586bfce10d
objfun: Add equality support.
11 years ago
Damien George
38d3430320
stmhal: Add more escape seqs; add debugging output for escape seq.
11 years ago
Paul Sokolovsky
bfb7d6a26d
py: Support 3-arg getattr() builtin (with default value).
11 years ago
Damien George
80c59c06e3
Merge branch 'xterm-home-end' of github.com:pfalcon/micropython into pfalcon-xterm-home-end
11 years ago
Paul Sokolovsky
438d504e27
objtype: Add equality test for type types.
11 years ago
Paul Sokolovsky
91cbe6033a
py: Allow types to be hashable.
Quite natural to have d[int] = handle_int .
11 years ago
Paul Sokolovsky
c6813d92db
py: Put default namespace into module __main__.
That's how CPython has it, in particular, "import __main__" should work.
11 years ago
Paul Sokolovsky
4a088f4b61
map: When removing a key, don't NULL the entry, but mark as deleted.
When searching next time, such entry should be just skipped, not terminate
the search. It's known that marking techique is not efficient at the presense
of many removes, but namespace usage should not require many deletes, and
as for user dictionaries - well, open addressing map table with linear
rehashing and load factor of ~1 is not particularly efficient at all ;-).
TODO: May consider "shift other entries in cluster" approach as an
alternative.
11 years ago
Paul Sokolovsky
a0d32991ed
mp_load_name(): Optimize for outer scope where locals == globals.
11 years ago
Paul Sokolovsky
e3f58c8380
map: Add mp_map_dump() (#ifdef'ed) to be handy when debugging maps.
11 years ago
Paul Sokolovsky
cdffa32699
stmhal readline: Parse XTERM Home/End key codes.
Which are ESC O H, ESC O F.
11 years ago
Paul Sokolovsky
c39368427c
unix: Rename module sources per latest naming conventions (mod*.c).
11 years ago
Paul Sokolovsky
cd31d826bf
unix: Use STATIC modifier to enable code size analysis via map file.
11 years ago
Damien George
6582a4170d
Merge pull request #421 from dhylands/git-version
Add the git version and build-date to the banner
11 years ago
Paul Sokolovsky
70193b2b4c
unix: Routines related to terminal reading should use system malloc.
Otherwise we have mixup between system and GC alloc.
11 years ago
Paul Sokolovsky
a7752a4540
run-tests: Elaborate python3 command override capabilities.
11 years ago
Damien George
e8208a7f02
py: Make False and True act like 0 and 1 for integer arithmetic.
11 years ago
Damien George
d7aadcfe1b
py: Allow dict constructor to take keyword arguments.
11 years ago
Damien George
36f0ee1a54
py: Remove mp_obj_less (use mp_binary_op(MP_BINARY_OP_LESS..) instead).
11 years ago
Damien George
bd17e1b3ae
unix: Allocate more heap memory by default on 64 bit machines.
Pointers are 2x bigger on 64 bit machines, so we should allocate twice
the memory to have a comparable heap size.
11 years ago
Damien George
9b1599c663
Merge pull request #422 from dhylands/str-modulo
Str modulo
11 years ago
Damien George
af27259439
py: Enable optimisation of multiplying 2 small ints in compiler.
11 years ago
Damien George
28390340e5
tests: Make rge-sm.py use less memory (integration step increased).
In addition to memory allocation failure, other problem was that 10**17
was overflowing. Now passes.
11 years ago
Damien George
ecf5b77123
py: This time, real proper overflow checking of small int power.
Previous overflow test was inadequate.
11 years ago
Damien George
6902eeda25
py: Add m_malloc_fail function to handle memory allocation error.
A malloc/realloc fail now throws MemoryError.
11 years ago
Paul Sokolovsky
072cf022e0
tests/file-with: Add testcase which failed for @dpgeorge .
Works on x86.
11 years ago
Dave Hylands
6756a37a77
Implements most of str.modulo
The alternate form for floating point doesn't work yet.
The %(name)s form doesn't work yet.
11 years ago
Dave Hylands
bf7d690e36
Add the git version to the banner
11 years ago
Damien George
5bf565e353
py: Handle small int power overflow correctly.
11 years ago
Damien George
4b34c76fd6
Changes to get unix/ port compiling on Cygwin.
11 years ago
Damien George
3996611c1b
stmhal: Add home/end cursor support in readline.
Home/end work in picocom and screen (different codes in those 2
programs). Also, CTRL-A (for non-empty liny) and CTRL-E act as
home/end.
11 years ago
mux
4f7e9f5c44
Implement del
11 years ago
Damien George
3269cf2f93
Merge pull request #419 from pfalcon/stmhal-file-streams
stmhal: Reimplement file support using stream protocol API.
11 years ago
Damien George
2309369291
tests: Allow to run tests on pyboard.
To run the tests on the pyboard you need to set the "test_on_pyboard"
variable to "True", and also have tools/pyboard.py available for import
(easiest is to symlink to it).
11 years ago
Damien George
d71fc37af7
tools: Improve reading back from pyboard.
11 years ago
Damien George
57ad7aa66b
stmhal: On soft reset, if in raw REPL mode, don't run main.py.
11 years ago
Damien George
0e49642965
tools: pyboard.py can now execute a file remotely!
11 years ago
Damien George
d8b47d3e02
stmhal: Fix raw REPL so that it passes through more ASCII chars.
11 years ago
Damien George
769b23a9c6
stmhal: Add powf, logf, log2f, log10f.
11 years ago
Damien George
aba9f51fef
stmhal: #undef log2f if it's defined.
11 years ago
Paul Sokolovsky
6693e6c506
README: ARM Linux is supported.
Retested again on Ubuntu 12.04 armhf running in chroot on Samsung
ARM Chromebook (Cortex-A15).
11 years ago
Paul Sokolovsky
1d4d9ddd9e
stmhal: Reimplement file support using stream protocol API.
This adds readline(), readall(), etc. methods. Also other fixes to make
Python API compliant and "with" support.
11 years ago
Paul Sokolovsky
34e1199b3a
run-tests: Allow to override python3 command to use via environment var.
11 years ago
Paul Sokolovsky
c61ce96590
unix file: Implement context manager protocol (for "with" statement).
11 years ago