| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
| |
This patch eliminates the need for a nested parse node for assignments
and keyword arguments. It saves a little bit of RAM when parsing.
|
| |
|
|
|
|
| |
Also adds tests specifically for testing constant folding.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
This patch adds more fine grained error message control for errors when
parsing integers (now has terse, normal and detailed). When detailed is
enabled, the error now escapes bytes when printing them so they can be
more easily seen.
|
| |
|
|
|
|
|
| |
It's relatively small (between 44 and 56 bytes) and helps to reduce heap
pressure and fragmentation during compilation.
|
|
|
|
|
| |
Saves a few bytes of code space and eliminates need for rot_two
bytecode (hence saving RAM and execution time, by a tiny bit).
|
| |
|
|
|
|
|
|
|
| |
Escaped quotes are now recognised correctly in REPL when used
inside normal quotes.
Fixes: #1419
|
| |
|
|
|
|
| |
Configurable with MICROPY_PY_BUILTINS_SLICE_ATTRS. Disabled by default.
|
|
|
|
|
|
|
|
| |
When creating constant mpz's, the length of the mpz must be exactly how
many digits are used (not allocated) otherwise these numbers are not
compatible with dynamically allocated numbers.
Addresses issue #1448.
|
|
|
|
|
|
|
|
|
| |
4 spaces are added at start of line to match previous indent, and if
previous line ended in colon.
Backspace deletes 4 space if only spaces begin a line.
Configurable via MICROPY_REPL_AUTO_INDENT. Disabled by default.
|
|
|
|
| |
Fixes #1435.
|
|
|
|
| |
Eg 0e0 almost looks like a hex number but in fact is a float.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Otherwise something like bytes(abc=123) will succeed.
|
| |
|
|
|
|
|
|
| |
This optimises (in speed and code size) for the common case where the
binary op for the bool object is supported. Unsupported binary ops
still behave the same.
|
|
|
|
|
|
| |
Function annotations are only needed when the native emitter is enabled
and when the current scope is emitted in viper mode. All other times
the annotations can be skipped completely.
|
|
|
|
|
|
| |
Fetch the current usb mode and return a string representation when
pyb.usb_mode() is called with no args. The possible string values are interned
as qstr's. None will be returned if an incorrect mode is set.
|
| |
|
| |
|
|
|
|
|
|
| |
Gets rid of redundant double check for string type.
Also remove obsolete declaration of mp_obj_str_get_hash.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
By issuing a warning that exception chaining is not supported, and ignoring
"from Y" argument.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Was KeyError, should be ValueError.
|
| |
|
|
|
|
|
|
| |
Indeed, this flag efectively selects architecture target, and must
consistently apply to all compiles and links, including 3rd-party
libraries, unlike CFLAGS, which have MicroPython-specific setting.
|
| |
|
|
|
|
| |
Saves 320 bytes on x86.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
unix-cpy was originally written to get semantic equivalent with CPython
without writing functional tests. When writing the initial
implementation of uPy it was a long way between lexer and functional
tests, so the half-way test was to make sure that the bytecode was
correct. The idea was that if the uPy bytecode matched CPython 1-1 then
uPy would be proper Python if the bytecodes acted correctly. And having
matching bytecode meant that it was less likely to miss some deep
subtlety in the Python semantics that would require an architectural
change later on.
But that is all history and it no longer makes sense to retain the
ability to output CPython bytecode, because:
1. It outputs CPython 3.3 compatible bytecode. CPython's bytecode
changes from version to version, and seems to have changed quite a bit
in 3.5. There's no point in changing the bytecode output to match
CPython anymore.
2. uPy and CPy do different optimisations to the bytecode which makes it
harder to match.
3. The bytecode tests are not run. They were never part of Travis and
are not run locally anymore.
4. The EMIT_CPYTHON option needs a lot of extra source code which adds
heaps of noise, especially in compile.c.
5. Now that there is an extensive test suite (which tests functionality)
there is no need to match the bytecode. Some very subtle behaviour is
tested with the test suite and passing these tests is a much better
way to stay Python-language compliant, rather than trying to match
CPy bytecode.
|