Damien George
aedb859177
py: Make float representation configurable with object representation.
2015-10-20 12:35:40 +01:00
Damien George
7e359c648b
py: Move float e/pi consts to objfloat and make mp_obj_float_t private.
2015-10-20 12:35:17 +01:00
Damien George
aaef1851a7
py: Add mp_obj_is_float function (macro) and use it where appropriate.
2015-10-20 12:35:17 +01:00
Paul Sokolovsky
e0f5df579b
all: Make netutils.h available to all ports by default.
...
Generally, ports should inherit INC from py.mk, append to it, not
overwrite it. TODO: Likely should do the same for other vars too.
2015-10-19 18:32:42 +03:00
Paul Sokolovsky
8ee153f234
unix/modtime: Implement ticks_ms(), ticks_us() and ticks_diff().
...
All of these functions return positive small int, thus range is 2 bits less
than word size (30 bit on 32-bit systems, 62 bit on 64-bit systems).
2015-10-19 17:48:27 +03:00
Damien George
096d1e4512
py: Add lsl/lsr/asr opcode support to inline Thumb2 assembler.
2015-10-19 14:26:19 +01:00
Paul Sokolovsky
7799410950
py/stream: Allow to reuse is_nonblocking_error().
2015-10-18 15:39:33 +03:00
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