Damien George
94f68300f9
py: Make str.replace do 2 passes over the string.
2014-01-31 23:45:12 +00:00
Damien George
1aa1c511dd
Merge branch 'master' of github.com:xbe/micropython into xbe-master
2014-01-31 23:29:57 +00:00
Markus Siemens
2c2a124e16
Fix SIGSEV when running "a"()
...
rt_call_function_n_kw did check for integers but not for strings
being called. Added a check so running "a"() won't SIGSEV but
throw an exception.
2014-01-31 22:16:23 +01:00
Paul Sokolovsky
c9887cbbe2
Add basic try-finally testcase.
...
It's mildly suprising these work without further changes to exception
handling code (the only change required was to handle SETUP_FINALLY).
2014-01-31 21:33:07 +02:00
Paul Sokolovsky
8519342c1a
Update VM stacks comments.
2014-01-31 19:48:53 +02:00
Paul Sokolovsky
c7a0b14df9
vm: Introduce structure for exception stack entry, record entry type.
...
Also, handle SETUP_FINALLY opcode.
2014-01-31 19:48:53 +02:00
Paul Sokolovsky
7ee8e46878
Dump 4 more bytecodes (loop and finally ones).
2014-01-31 19:47:30 +02:00
Paul Sokolovsky
027594e1a7
Typo fixes in comments.
2014-01-31 19:47:23 +02:00
Paul Sokolovsky
c92a56dc93
Add testcase with exception handler spread across functions.
2014-01-31 17:06:15 +02:00
xbe
480c15afb5
Implement str.replace and add tests for it.
2014-01-30 22:17:30 -08:00
xbe
65365778fd
Add tests for str.strip
2014-01-30 22:16:47 -08:00
Damien George
3f759b71c6
py: Add MICROPY_ENABLE_FLOAT around a float specific piece of code.
2014-01-31 00:42:12 +00:00
Damien George
28f93fbb48
Merge pull request #239 from pfalcon/end_finally
...
vm: Add basic implementation of END_FINALLY opcode.
2014-01-30 14:30:41 -08:00
Damien George
65ae601665
Merge pull request #240 from msiemens/windows_fix
...
windows: Make windows/main.c independent from unix/main.c
2014-01-30 14:28:38 -08:00
Damien George
39631bc312
Fix Makefiles: -O3 option was not being applied; mkdir for STM.
2014-01-30 22:16:51 +00:00
Markus Siemens
7e0dee0cbf
windows: Make windows/main.c independent from unix/main.c
...
Up to know changes unix/main.c were able to break the windows
build because windows/main.c simply included unix/main.c.
Now windows/main.c stands on it's own and won't break if
unix/main.c changes.
2014-01-30 17:13:16 +01:00
Paul Sokolovsky
382e8eeea2
vm: Add basic implementation of END_FINALLY opcode.
...
Allows to have nested try blocks with except filters.
TODO: Don't add END_FINALLY's exception re-raise points to traceback.
2014-01-30 13:49:18 +02:00
Damien George
09a0c64bce
py: Improve __bool__ and __len__ dispatch; add slots for them.
2014-01-30 10:05:33 +00:00
Damien George
b25711ea8f
Merge pull request #238 from pfalcon/bool_len
...
Implement __bool__ and __len__ via unary_op virtual method for all types.
2014-01-30 01:29:32 -08:00
Paul Sokolovsky
c1d9bbc345
Implement __bool__ and __len__ via unary_op virtual method for all types.
...
__bool__() and __len__() are just the same as __neg__() or __invert__(),
and require efficient dispatching implementation (not requiring search/lookup).
type->unary_op() is just the right choice for this short of adding
standalone virtual method(s) to already big mp_obj_type_t structure.
2014-01-30 04:37:19 +02:00
Paul Sokolovsky
cdd2c62e07
realloc(): Log original memory ptr too.
...
To alloc complete memory alloc flow tracing.
2014-01-30 03:58:17 +02:00
Damien George
4a74d31e70
run-tests can handle segfault.
2014-01-29 22:32:23 +00:00
Damien George
14b929f1d9
Merge branch 'master' of github.com:msiemens/micropython into msiemens-master
2014-01-29 22:24:35 +00:00
Damien George
62ad189a65
py: Add compile option to enable/disable source line numbers.
2014-01-29 21:51:51 +00:00
Damien George
2d15c1216d
stm: Add optional memory debugging output.
2014-01-29 20:33:20 +00:00
Damien George
d0691ccaec
py: Simplify fastn in VM; reduce size of unique code struct.
...
We still have FAST_[0,1,2] byte codes, but they now just access the
fastn array (before they had special local variables). It's now
simpler, a bit faster, and uses a bit less stack space (on STM at least,
which is most important).
The only reason now to keep FAST_[0,1,2] byte codes is for compressed
byte code size.
2014-01-29 20:30:52 +00:00
Damien George
01fa4a9164
stm: Fix gccollect ram range.
2014-01-29 19:21:17 +00:00
Damien George
0347fbd2d5
Merge branch 'master' of github.com:iabdalkader/micropython
2014-01-29 19:04:59 +00:00
Damien George
08d075592f
py: Fix bug with LOAD_METHOD; fix int->machine_int_t for small int.
...
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.
2014-01-29 18:58:52 +00:00
Damien George
1ba1facaaa
py: Msg in exception is no longer interned.
2014-01-29 18:57:20 +00:00
Damien George
4d5b28cd08
Add qstr_info() function and bindings for unix port.
2014-01-29 18:56:46 +00:00
mux
bfb01e9da6
Fix unused function warning in main
...
* Add SD card test to fix warning
2014-01-29 15:07:04 +02:00
mux
8592d85b36
Remove redundant include in file.c
...
* Remove include mpconfigport.h from file.c
2014-01-29 15:05:53 +02:00
mux
76a6335b6e
Move HEAP_END and RAM_END to linker script
...
* Issue #232
2014-01-29 12:52:03 +02:00
Damien George
217814cc63
stm: Increase timeout for RTC LSE startup; use backup regs.
2014-01-28 23:47:28 +00:00
Damien George
e4b6a079b3
py: Implement 'not' in compiler, and improve rt_is_true.
2014-01-28 23:27:35 +00:00
Damien George
b40892d266
Rename array test to array1 so it doesn't clash with array module.
...
On my machine, 'import array' in CPython tries to load the array test.
2014-01-28 23:12:35 +00:00
Damien George
8bf91f2a87
unix: Fix compile warnings for ffi module on 64-bit machine.
2014-01-28 23:08:11 +00:00
Damien George
4729a0ccea
Merge pull request #235 from pfalcon/modffi
...
unix: Initial FFI module implementation
2014-01-28 14:53:12 -08:00
Paul Sokolovsky
809eaa2679
Add FFI module example.
2014-01-29 00:37:09 +02:00
Paul Sokolovsky
60a9fac8d4
unix: Initial implementation of FFI module.
...
Foreign Function Interface module allows to load native dynamic libraries,
call functions and access variables in them. This makes possible to write
interface modules in pure Python.
This module provides thin wrapper around libffi. ctypes compatibility might
be possible to implement on top of this module (though ctypes allow to call
functions without prototypes, which is not supported by libffi (i.e.
implementation would be inefficient))).
2014-01-29 00:24:00 +02:00
Paul Sokolovsky
7f11c794a5
mp_obj_new_bytearray_by_ref(): Allow to create array by reference.
...
This is special feature for FFI.
2014-01-29 00:21:41 +02:00
Markus Siemens
242856cfbf
Fixed problems with nlx86.S on Linux
...
Fixed '#ifdef's so Linux would compile again and added
.scl and .type for Windows.
2014-01-28 19:52:04 +01:00
Markus Siemens
19ccc6bdc7
Added Windows port (see #233 )
2014-01-28 18:21:05 +01:00
Paul Sokolovsky
1801421f6d
bytearray: Print objects properly.
2014-01-28 03:40:48 +02:00
Paul Sokolovsky
0b7e29c025
Factor out quoted string print function for reuse (mp_str_print_quoted()).
2014-01-28 03:40:06 +02:00
Paul Sokolovsky
8e991e0680
Add basic array.array test.
2014-01-28 03:19:32 +02:00
Paul Sokolovsky
7e652af242
array: CPython prints empty arrays inconsistently (only typecode, no []).
2014-01-28 03:19:13 +02:00
Paul Sokolovsky
0dd0467a97
Don't pre-import array module.
2014-01-28 03:18:30 +02:00
Paul Sokolovsky
11973b48b5
array.array: Allow to create empty arrays.
2014-01-28 03:18:30 +02:00