Paul Sokolovsky
0473e2790b
Fix thinko with how bitfields were added to mp_obj_fun_native_t.
Structure is back to expected 16 bytes.
11 years ago
Damien George
93d004f4b0
Merge branch 'xbe-master'
11 years ago
Damien George
330cf6d04a
Change id to return signed integer.
11 years ago
Damien George
09e1f43200
Merge branch 'master' of github.com:micropython/micropython
11 years ago
Damien George
cd82e02e84
py: Partially fix native emitter to work with latest runtime.
Native emitter has been broken since stack order has changed from
reverse to standard. This fix gets it partially working.
11 years ago
Paul Sokolovsky
ea2509d92c
Fix assert() usage.
11 years ago
Paul Sokolovsky
6964422cf4
unix time.clock(): Actually return float value.
11 years ago
Paul Sokolovsky
87e85b7dc7
Implement str/bytes rich comparisons.
11 years ago
xbe
0ebf8534ab
Implement and add tests for the id() builtin function.
11 years ago
Paul Sokolovsky
9ed5435061
Implement slicing for tuples.
11 years ago
Paul Sokolovsky
13cfabd1b2
Implement slicing for lists.
11 years ago
Paul Sokolovsky
7364af2d8c
Factor out m_seq_get_fast_slice_indexes() fucntions as sequence helper.
Takes slice object and sequence length and computes subsequence indexes
for case of slice step=1.
11 years ago
Paul Sokolovsky
a9459bc723
unix: Add basic time module (with time() and clock() functions).
Both return int so far (single-precision float doesn't have enough
bits to represent int32 precisely).
11 years ago
Paul Sokolovsky
513e6567b1
Add testcase for sequence unpacking.
11 years ago
Paul Sokolovsky
edbdf71f5c
rt_unpack_sequence(): Support generic iterables.
11 years ago
Damien George
48697f1dd2
Tidy up some comments.
11 years ago
Damien George
9aa2a527b5
py: Tidy up BINARY_OPs; negation done by special NOT bytecode.
IS_NOT and NOT_IN are now compiled to IS + NOT and IN + NOT, with a new
special NOT bytecode.
11 years ago
Damien George
7e5fb24e3b
py: Reduce code size of compiler by a bit.
11 years ago
Damien George
e24b563796
py: Fix emitcpy so continue is compatible with CPython.
11 years ago
Damien George
cbddb279bb
py: Implement break/continue from an exception with finally.
Still todo: break/continue from within the finally block itself.
11 years ago
Damien George
a908202d60
unix: libffi include path now found using pkg-config.
Hopefully this works for other people as well :)
11 years ago
Damien George
6fcaea6ca8
Merge pull request #254 from pfalcon/config-modules
Add mpconfigport.mk file to configure which modules to include into build
11 years ago
Damien George
fb083ea986
py: mp_execute_byte_code has 2 arg arrays, for more efficient default params.
11 years ago
Paul Sokolovsky
ed1239fce6
Add mpconfigport.mk file to configure which modules to include into build.
Proof of concept, controls "ffi" module as one which requires external
dependencies.
11 years ago
Damien George
87413a4d0c
Merge branch 'fun-defargs' of github.com:pfalcon/micropython into pfalcon-fun-defargs
11 years ago
Damien George
382b3d00ed
Merge pull request #251 from pfalcon/return_unwind
Add exception stack unwind support for RETURN_VALUE.
11 years ago
Damien George
d71cd86dc1
Merge branch 'iabdalkader-master'
Conflicts:
stm/usb.c
stm/usb.h
11 years ago
Damien George
01156d510c
stm: Add support for ctrl-C to interrupt running Python.
Using PendSV interrupt at lowest priority, code can now raise an
exception during an interrupt by calling pendsv_nlr_jump. The exception
will be raised when all interrupts are finished. This is used to trap
ctrl-C from the USB VCP to break out of running Python code.
11 years ago
mux
565fdccfd2
Add usb_vcp_connected prototype to usb.h
11 years ago
Paul Sokolovsky
90750029df
Implement default function arguments (for Python functions).
TODO: Decide if we really need separate bytecode for creating functions
with default arguments - we would need same for closures, then there're
keywords arguments too. Having all combinations is a small exponential
explosion, likely we need just 2 cases - simplest (no defaults, no kw),
and full - defaults & kw.
11 years ago
Paul Sokolovsky
6472dea146
Add exception stack unwind support for RETURN_VALUE.
This properly implements return from try/finally block(s).
TODO: Consider if we need to do any value stack unwinding for RETURN_VALUE
case. Intuitively, this is "success" return, so value stack should be in
good shape, and unwinding shouldn't be required.
11 years ago
mux
b2269b610e
Detect VCP line state.
* Detect VCP line state, based on SET_CONTROL_LINE_STATE request
11 years ago
Damien George
532f2c30f6
Merge pull request #246 from pfalcon/exc_stack_entry
vm: Introduce structure for exception stack entry, record entry type.
11 years ago
Damien George
8b56beb1a1
py: Simplified rt_call_function_n_kw.
11 years ago
Damien George
f3b05449cc
Merge branch 'fix_str_call' of github.com:msiemens/micropython into msiemens-fix_str_call
11 years ago
Damien George
94f68300f9
py: Make str.replace do 2 passes over the string.
11 years ago
Damien George
1aa1c511dd
Merge branch 'master' of github.com:xbe/micropython into xbe-master
11 years ago
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.
11 years ago
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).
11 years ago
Paul Sokolovsky
8519342c1a
Update VM stacks comments.
11 years ago
Paul Sokolovsky
c7a0b14df9
vm: Introduce structure for exception stack entry, record entry type.
Also, handle SETUP_FINALLY opcode.
11 years ago
Paul Sokolovsky
7ee8e46878
Dump 4 more bytecodes (loop and finally ones).
11 years ago
Paul Sokolovsky
027594e1a7
Typo fixes in comments.
11 years ago
Paul Sokolovsky
c92a56dc93
Add testcase with exception handler spread across functions.
11 years ago
xbe
480c15afb5
Implement str.replace and add tests for it.
11 years ago
xbe
65365778fd
Add tests for str.strip
11 years ago
Damien George
3f759b71c6
py: Add MICROPY_ENABLE_FLOAT around a float specific piece of code.
11 years ago
Damien George
28f93fbb48
Merge pull request #239 from pfalcon/end_finally
vm: Add basic implementation of END_FINALLY opcode.
11 years ago
Damien George
65ae601665
Merge pull request #240 from msiemens/windows_fix
windows: Make windows/main.c independent from unix/main.c
11 years ago
Damien George
39631bc312
Fix Makefiles: -O3 option was not being applied; mkdir for STM.
11 years ago