| Commit message (Collapse) | Author | Age |
|
|
|
| |
Remove unnecessary includes. Add includes that improve portability.
|
|
|
|
|
|
| |
Implement not, shl and shr in mpz library. Add function to create mpzs
on the stack, used for memory efficiency when rhs is a small int.
Factor out code to parse base-prefix of number into a dedicated function.
|
|
|
|
|
| |
Based on suggestion by @dpgeorge at
https://github.com/micropython/micropython/pull/313
|
|
|
|
|
|
| |
Specifically, VM's small ints are 31 bit, while parser's only 28. There's already
MP_OBJ_FITS_SMALL_INT(), so, for clarity, rename MP_FIT_SMALL_INT() to
MP_PARSE_FITS_SMALL_INT().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Each built-in exception is now a type, with base type BaseException.
C exceptions are created by passing a pointer to the exception type to
make an instance of. When raising an exception from the VM, an
instance is created automatically if an exception type is raised (as
opposed to an exception instance).
Exception matching (RT_BINARY_OP_EXCEPTION_MATCH) is now proper.
Handling of parse error changed to match new exceptions.
mp_const_type renamed to mp_type_type for consistency.
|
| |
|
|
|
|
|
|
|
|
| |
LOAD_METHOD bug was: emitbc did not correctly calculate the amount of
stack usage for a LOAD_METHOD operation.
small int bug was: int was being used to pass small ints, when it should
have been machine_int_t.
|
| |
|
|
|
|
| |
TODO: Check lexer/parse/compile error path for leaks too.
|
| |
|
|
|
|
|
| |
Can now have null bytes in strings. Can define ROM qstrs per port using
qstrdefsport.h
|
|
|
|
|
|
|
| |
Exceptions know source file, line and block name.
Also tidy up some debug printing functions and provide a global
flag to enable/disable them.
|
|
|
|
|
| |
Byte code has a map from byte-code offset to source-code line number,
used to give better error messages.
|
| |
|
|
|
|
|
| |
Parser no longer prints an error, but instead returns an exception ID
and message.
|
|
|
|
|
|
| |
Long int is something which doesn't fit into SMALL_INT partion of
machine_int_t. But it's also something which doesn't fit into
machine_int_t in the first place.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
A big change. Micro Python objects are allocated as individual structs
with the first element being a pointer to the type information (which
is itself an object). This scheme follows CPython. Much more flexible,
not necessarily slower, uses same heap memory, and can allocate objects
statically.
Also change name prefix, from py_ to mp_ (mp for Micro Python).
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|