| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
| |
This is how CPython does it, and it's very useful to help users discover
the available modules for a given port, especially built-in and frozen
modules. The function does not list modules that are in the filesystem
because this would require a fair bit of work to do correctly, and is very
port specific (depending on the filesystem).
|
| |
|
|
|
|
|
| |
This builtin is configured using MICROPY_PY_BUILTINS_HELP, and is disabled
by default.
|
|
|
|
| |
To be implemented later.
|
|
|
|
|
|
|
| |
If result guaranteedly fits in a small int, it is handled in objint.c.
Otherwise, it is delegated to mp_obj_int_from_bytes_impl(), which should
be implemented by individual objint_*.c, similar to
mp_obj_int_to_bytes_impl().
|
| |
|
| |
|
|
|
|
|
| |
The if-block that this unreachable code is in has a condition "f>=5" so
"fp_isless1(f)" will always fail.
|
|
|
|
|
| |
Previouly, we had errors checked in callers, which led to duplicate code
or missing checks in some places.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This helps to improve code coverage. Note that most of the changes in
this patch are just de-denting the cases of the switch statements.
|
|
|
|
| |
In this case it's allowed to be ignored.
|
|
|
|
| |
Arguments to throw() for generators don't need to be exceptions.
|
|
|
|
|
|
| |
If GeneratorExit is injected as a throw-value then that should lead to
the close() method being called, if it exists. If close() does not exist
then throw() should not be called, and this patch fixes this.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
The commit d9047d3c8a99603884db25076c37778f50633ca6 introduced a bug
whereby "from a.b import c" stopped working for frozen packages. This is
because the path was not properly truncated and became "a//b". Such a
path resolves correctly for a "real" filesystem, but not for a search in
the list of frozen modules.
|
|
|
|
| |
So that ports can pass their own custom options to mpy-cross.
|
| |
|
| |
|
|
|
|
|
| |
One never needs to format integers with a base larger than 16 (but code
can be easily extended beyond this value if needed in the future).
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This function should be able to parse integers with any value for the
base, because it is called by int('xxx', base).
|
|
|
|
|
|
|
|
| |
UART REPL support was lost in os.dupterm() refactorings, etc. As
os.dupterm() is there, implement UART REPL support at the high level -
if MICROPY_STDIO_UART is set, make default boot.py contain os.dupterm()
call for a UART. This means that changing MICROPY_STDIO_UART value will
also require erasing flash on a module to force boot.py re-creation.
|
| |
|
|
|
|
|
| |
The lexer is very mature and this debug function is no longer used. If
it's really needed one can uncomment it and recompile.
|
|
|
|
|
|
|
|
| |
This check always fails (ie chr0 is never EOF) because the callers of this
function never call it past the end of the input stream. And even if they
did it would be harmless because 1) reader.readbyte must continue to
return an EOF char if the stream is exhausted; 2) next_char would just
count the subsequent EOF's as characters worth 1 column.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
import utimeq, utime
# Max queue size, the queue allocated statically on creation
q = utimeq.utimeq(10)
q.push(utime.ticks_ms(), data1, data2)
res = [0, 0, 0]
# Items in res are filled up with results
q.pop(res)
|
| |
|
|
|
|
|
|
| |
And also simplify it to remove the check for small int. This can be done
because this function is only ever called if the argument is not a small
int.
|
| |
|
|
|
|
|
| |
It needs an extra pass to compute the size of the constant table for the
l32r instructions.
|
|
|
|
|
|
|
|
| |
Defining and initialising mp_kbd_exception is boiler-plate code and so the
core runtime can provide it, instead of each port needing to do it
themselves.
The exception object is placed in the VM state rather than on the heap.
|
|
|
|
|
|
| |
sys.exit() is an important function to terminate a program. In particular,
the testsuite relies on it to skip tests (i.e. any other functionality may
be disabled, but sys.exit() is required to at least report that properly).
|
|
|
|
|
| |
There's no need to force ports to copy-and-paste this initialisation
code. If FSUSERMOUNT is enabled then this zeroing out must be done.
|
| |
|
|
|
|
|
| |
This patch ensures that __init__.mpy files are imported if their
containing directory is imported as a package.
|
| |
|
|
|
|
|
| |
CPython requires byteorder arg, make uPy compatible. As we support only
"little", error out on anything else.
|
| |
|
|
|
|
|
|
|
|
| |
For all but the last pass the assembler only needs to count how much space
is needed for the machine code, it doesn't actually need to emit anything.
The dummy_data just uses unnecessary RAM and without it the code is not
any more complex (and code size does not increase for Thumb and Xtensa
archs).
|
|
|
|
|
|
| |
This patch moves some common code from the individual inline assemblers to
the compiler, the code that calls the emit-glue to assign the machine code
to the functions scope.
|
|
|
|
|
| |
These are generic methods that don't depend on the architecture and so
can be handled directly by the compiler.
|