Damien George
035a0a2b6e
py: Add support for _ in REPL to hold last computed value.
...
Only available when MICROPY_CAN_OVERRIDE_BUILTINS is enabled.
2015-10-17 12:55:25 +01:00
Damien George
e813541e3f
py: Add option for inline assembler to support ARMv7-M instructions.
...
Cortex-M0, M0+ and M1 only have ARMv6-M Thumb/Thumb2 instructions. M3,
M4 and M7 have a superset of these, named ARMv7-M. This patch adds a
config option to enable support of the superset of instructions.
2015-10-16 22:08:57 +01:00
Damien George
4bf3f2d3c0
py: Fix with+for+return bug by popping for-iter when unwinding exc stack.
...
Addresses issue #1182 .
2015-10-15 17:48:28 +01:00
Damien George
4300c7dba2
py: Remove dependency on printf/fwrite in mp_plat_print.
...
See issue #1500 .
2015-10-15 00:05:55 +01:00
Damien George
d7e3b36a09
py/compile: Remove unnecessary label in compilation of for statement.
2015-10-14 15:51:12 +01:00
Damien George
fcce1483fa
py: Fix build of ARM native emitter due to recent viper changes.
...
Addresses #1510 .
2015-10-14 12:40:54 +01:00
Damien George
59a41e8fcd
py/qstr: Fix calc of qstr memory usage, due to new qstr chunk allocation.
2015-10-13 15:52:06 +01:00
Damien George
b8f9ac5411
py: Implement ptr32 load and store in viper emitter.
2015-10-13 00:50:17 +01:00
Damien George
3c9c3687d6
py: Add support to call __init__ from a builtin module on first import.
2015-10-12 13:46:01 +01:00
Paul Sokolovsky
408b74d74c
py: Allow to to build MicroPython as a static library.
...
The whole current port gets slurped into a static lib named
"libmicropython.a". Maybe that's not ideal, but at least something
to start with.
2015-10-12 15:32:06 +03:00
Damien George
fdfcee7b1e
py/parse: Make parser error handling cleaner, less spaghetti-like.
2015-10-12 12:59:18 +01:00
Damien George
64f2b213bb
py: Move constant folding from compiler to parser.
...
It makes much more sense to do constant folding in the parser while the
parse tree is being built. This eliminates the need to create parse
nodes that will just be folded away. The code is slightly simpler and a
bit smaller as well.
Constant folding now has a configuration option,
MICROPY_COMP_CONST_FOLDING, which is enabled by default.
2015-10-12 12:58:45 +01:00
Paul Sokolovsky
91fc075a33
py/objarray: Allow to create array of void pointers, as extension to CPython.
...
Using 'P' format specifier (matches struct module). This is another shortcut
for FFI, just as previously introduced "array of objects" ('O').
2015-10-12 10:13:51 +03:00
Paul Sokolovsky
1b586f3a73
py: Rename MP_BOOL() to mp_obj_new_bool() for consistency in naming.
2015-10-11 15:18:15 +03:00
Paul Sokolovsky
53ca6ae1f3
py/makeqstrdata.py: Catch and report case of empty input file.
...
The usual cause would be that a cross-compiler for a port is not in PATH.
2015-10-11 11:09:57 +03:00
Damien George
366239b8b9
py/parse: Factor logic when creating parse node from and-rule.
2015-10-08 23:13:18 +01:00
Damien George
b948de36fb
py: Don't generate unnecessary parse nodes for assignment or kwargs.
...
This patch eliminates the need for a nested parse node for assignments
and keyword arguments. It saves a little bit of RAM when parsing.
2015-10-08 14:26:01 +01:00
Damien George
9f5f156b9d
py/emitnative: Raise ViperTypeError for unsupported unary ops.
2015-10-08 13:08:59 +01:00
Damien George
7e12a601b8
py/compile: Fix edge case when constant-folding negation of integer.
...
Also adds tests specifically for testing constant folding.
2015-10-08 13:02:00 +01:00
Paul Sokolovsky
aaa8867d4a
modussl: SSL socket wrapper module based on axTLS.
2015-10-06 18:10:39 +03:00
Damien George
0496de26d3
py: Allow to enable inline assembler without native emitter.
2015-10-03 17:07:54 +01:00
Damien George
58e0f4ac50
py: Allocate parse nodes in chunks to reduce fragmentation and RAM use.
...
With this patch parse nodes are allocated sequentially in chunks. This
reduces fragmentation of the heap and prevents waste at the end of
individually allocated parse nodes.
Saves roughly 20% of RAM during parse stage.
2015-10-02 00:11:11 +01:00
Damien George
e5635f4ab3
py: Catch all cases of integer (big and small) division by zero.
2015-10-01 22:48:48 +01:00
Damien George
2065373f67
py/mpz: Fix bignum anding of large negative with smaller positive int.
2015-10-01 22:35:06 +01:00
Damien George
2f4e8511cd
py/mpz: Force rhs of mpz_shl_inpl/mpz_shr_inpl to be unsigned.
...
Python semantics are that rhs of shift must be non-negative, so there's
no need to handle negative values in the underlying mpz implementation.
2015-10-01 18:01:37 +01:00