Paul Sokolovsky
d35ac956d1
input.c: Fix line-endings after recent changes.
10 years ago
Damien George
91bc32dc16
py: Provide typedefs for function types instead of writing them inline.
10 years ago
Damien George
4dea922610
py: Adjust some spaces in code style/format, purely for consistency.
10 years ago
stijn
df1637c580
unix: Automatically fix incompatible readline build options.
10 years ago
stijn
e50cff69bb
py: Use a dummy type for referring to extern structs
Fixes msvc linker warnings about mismatching sizes between the mp_obj_fdfile_t
struct defined in file.c and the mp_uint_t declarations found in modsys.c and modbuiltins.c
10 years ago
stijn
36cc84a2a9
py: Fix msvc warning '*/ found outside of comment'
Also prevents some of the weaker syntax parsers out there treating the whole
'*/*const*/' part as a comment
10 years ago
Damien George
e97dddcdca
docs: Document pyb.main function to set main script.
10 years ago
Damien George
9988618e0e
py: Implement full func arg passing for native emitter.
This patch gets full function argument passing working with native
emitter. Includes named args, keyword args, default args, var args
and var keyword args. Fully Python compliant.
It reuses the bytecode mp_setup_code_state function to do all the hard
work. This function is slightly adjusted to accommodate native calls,
and the native emitter is forced a bit to emit similar prelude and
code-info as bytecode.
10 years ago
Daniel Campora
18bd51707c
cc3200: Enable the stdio UART for the LaunchXL only.
10 years ago
Daniel Campora
c7acfc90b9
cc3200: Enable pull-ups for the STDIO UART pins.
10 years ago
Damien George
c9aa1883ed
py: Simplify bytecode prelude when encoding closed over variables.
10 years ago
Damien George
78772ada0d
py: Implement calling functions with *args in native emitter.
10 years ago
Paul Sokolovsky
282ca09f8e
py: Add MICROPY_PY_BUILTINS_REVERSED, disable for minimal ports.
10 years ago
Paul Sokolovsky
e2d44e30c7
py: Add MICROPY_PY_BUILTINS_ENUMERATE, disable for minimal ports.
10 years ago
Paul Sokolovsky
96b60ed956
cc3200: Fix typo after previous refactor.
10 years ago
Paul Sokolovsky
2192824ad8
teensy: Fix function prototype.
10 years ago
Paul Sokolovsky
3a84c8b58d
string0.c: Move from stmhal/ to lib/.
10 years ago
Damien George
e5c4362a98
tests: Add some more tests to improve code coverage of corner cases.
10 years ago
Damien George
97abe22963
tests: Add tests to exercise lexer; and some more complex number tests.
10 years ago
Damien George
9dd3640464
tests: Add missing tests for builtins, and many other things.
10 years ago
Damien George
7e758b1cf8
stmhal, qemu-arm: Enable sys.maxsize attribute.
10 years ago
Daniel Campora
b9d850227d
cc3200: Add WLAN AP specific settings for each board.
10 years ago
Damien George
56606f3475
py: Implement delete for property and descriptors.
Without this patch deleting a property, or class with descriptor, will
call the setter with a NULL value and lead to a crash.
10 years ago
Damien George
0528c5a22a
py: In str unicode, str_subscr will never be passed a bytes object.
10 years ago
Damien George
0f6424efda
docs: Bump version to 1.4.1.
10 years ago
Damien George
40fc01f406
stmhal: Enable new str.splitlines() method.
10 years ago
Damien George
2801e6fad8
py: Some trivial cosmetic changes, for code style consistency.
10 years ago
Paul Sokolovsky
7f59b4b2ca
objstr: Fix bugs introduced by inability to have shadow variables.
Warnings lead to programming errors - as expected.
10 years ago
Paul Sokolovsky
acf6aec71c
objstr: Avoid variable shadowing.
10 years ago
Paul Sokolovsky
620058cc57
tests: Add test for str.splitlines().
10 years ago
Paul Sokolovsky
ac2f7a7f6a
objstr: Add .splitlines() method.
splitlines() occurs ~179 times in CPython3 standard library, so was
deemed worthy to implement. The method has subtle semantic differences
from just .split("\n"). It is also defined as working for any end-of-line
combination, but this is currently not implemented - it works only with
LF line-endings (which should be OK for text strings on any platforms,
but not OK for bytes).
10 years ago
Damien George
82f37bf0d1
tests: Add specific test for closures in native emitter.
10 years ago
Damien George
fa5950eb00
py: Fix bug in native emitter when closing over an argument.
10 years ago
Damien George
99957384ea
py: Get native emitter working again with x86 (now supports closures).
10 years ago
Damien George
4cd9ced8dc
py: Implement closures in native code generator.
Currently supports only x64 and Thumb2 archs.
10 years ago
Damien George
2cc5473021
py: Implement (non-compliant) support for delete_fast in native emitter.
This implementation is smaller (in code size) than #1024 .
10 years ago
Damien George
c0dcf6e878
README: Add note about pic16bit port.
10 years ago
Damien George
43ea73faa6
pic16bit: Initial version of port to 16-bit PIC family.
Reference MCU is dsPIC33J256GP506 with 256k ROM and 8k RAM, on the dsPIC
DSC Starter Kit board. The REPL works, GC works, pyb module has LED and
Switch objects. It passes some tests from the test suite (most it can't
run because it doesn't have the Python features enabled).
10 years ago
Damien George
12ab9eda8d
py: Make heap printing compatible with 16-bit word size.
10 years ago
Damien George
3f327cc4c6
py: Allow MPZ_DIG_SIZE to be optionally configured by a port.
10 years ago
Damien George
567184e21e
py: Allow configurable object representation, with 2 different options.
10 years ago
Damien George
12a5e17afb
py: Add finer configuration of static funcs when not in stackless mode.
Also rename call_args_t to mp_call_args_t.
10 years ago
Paul Sokolovsky
dbc0191d5f
unix: Add stackless config settings, for easy access.
10 years ago
Paul Sokolovsky
7f1c98177b
vm: Support strict stackless mode, with proper exception reporting.
I.e. in this mode, C stack will never be used to call a Python function,
but if there's no free heap for a call, it will be reported as
RuntimeError (as expected), not MemoryError.
10 years ago
Paul Sokolovsky
f0a8f21190
vm: Implement stackless for CALL_FUNCTION_VAR_KW & CALL_METHOD_VAR_KW.
10 years ago
Paul Sokolovsky
e6c6fe3275
runtime: Split mp_call_prepare_args_n_kw_var() from mp_call_method_n_kw_var().
Allow for reuse for stackless design, where preparing args is separate from
calling.
10 years ago
Paul Sokolovsky
390e92688c
vm: Stackless support for MP_BC_CALL_METHOD.
10 years ago
Paul Sokolovsky
332a909d44
vm: If there's no heap to call function in stackless manner, call via C stack.
10 years ago
Paul Sokolovsky
2039757b85
vm: Initial support for calling bytecode functions w/o C stack ("stackless").
10 years ago
Paul Sokolovsky
f88eec0de2
makeqstrdata.py: Add support for strings with backslash escapes.
10 years ago