Age | Commit message (Collapse) | Author |
|
Don't print dupe ">>> " prompt when starting event-driven REPL. Clear
incomplete line in transition from raw to friendly REPL.
|
|
|
|
|
|
The lexer can now raise an exception on construction so it must go within
an nlr handler block.
|
|
|
|
|
|
Ports should no longer use pyhelp_print_obj but instead should define
MICROPY_PY_BUILTINS_HELP to 1 and then specify their help text using
MICROPY_PY_BUILTINS_HELP_TEXT.
|
|
Ultimately all ports that use lib/utils/interrupt_char would enable
MICROPY_KBD_EXCEPTION, so this is an interim solution.
|
|
With other ports. Other ports declare it in mphalport.h, it can be
inline or macro.
|
|
This happens with some compilers on some architectures, which don't define
size_t as unsigned int. MicroPython's printf() dooesn't support obscure
format specifiers for size_t, so the obvious choice is to explicitly cast
to unsigned, to match %u used in printf().
|
|
This patch removes a compilation warning in pyexec.
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
|
|
This patch introduces MP_PYTHON_PRINTER for general use.
|
|
In order to have more fine-grained control over how builtin functions are
constructed, the MP_DECLARE_CONST_FUN_OBJ macros are made more specific,
with suffix of _0, _1, _2, _3, _VAR, _VAR_BETEEN or _KW. These names now
match the MP_DEFINE_CONST_FUN_OBJ macros.
|
|
Setting the pyexec_system_exit variable to PYEXEC_FORCED_EXT allows
SystemExit exceptions to terminate the pyexec functions.
|
|
Now there is just one function to allocate a new vstr, namely vstr_new
(in addition to vstr_init etc). The caller of this function should know
what initial size to allocate for the buffer, or at least have some policy
or config option, instead of leaving it to a default (as it was before).
|
|
"Forced exit" is treated as soft-reboot (Ctrl+D). But expected effect of
calling sys.exit() is termination of the current script, not any further
and more serious actions like mentioned soft reboot.
|
|
Utility functions for keyboard interrupt handling, to be reused across
(baremetal) ports.
|
|
This new config option allows to control whether MicroPython uses its own
internal printf or not (if not, an external one should be linked in).
Accompanying this new option is the inclusion of lib/utils/printf.c in the
core list of source files, so that ports no longer need to include it
themselves.
|
|
|
|
|
|
|
|
|
|
Several ports use identical code for the 1-argument form of the builtin
help function. Move this code to a library function to allow easier
re-use by ports.
|
|
A port which uses lib/utils/pyexec.c but which does not enable garbage
collection should not need to implement the gc_collect function.
This patch also moves the gc_collect call to after printing the qstr
info. Since qstrs cannot be collected it should not make any difference
to the printed statistics.
|
|
The config variable MICROPY_MODULE_FROZEN is now made of two separate
parts: MICROPY_MODULE_FROZEN_STR and MICROPY_MODULE_FROZEN_MPY. This
allows to have none, either or both of frozen strings and frozen mpy
files (aka frozen bytecode).
|
|
By default it uses mp_plat_print, but a port may override it to another
value with MICROPY_DEBUG_PRINTER_DEST.
|
|
Before this change, if REPL blocked executing some code, it was possible
to still input new statememts and excuting them, all leading to weird,
and portentially dangerous interaction.
TODO: Current implementation may have issues processing input accumulated
while REPL was blocked.
|
|
Reference it from root pointers section.
|
|
This is a convenience function similar to pyexec_file. It should be used
instead of raw mp_parse_compile_execute because the latter does not catch
and report exceptions.
|
|
Was reported to break MacOSX build.
|
|
uclibc objects call __GI_vsnprintf().
|
|
|
|
|
|
|
|
|
|
In other words, unix port now uses overriden printf(), instead of using
libc's. This should remove almost all dependency on libc stdio (which
is bloated).
|
|
This may not seem like the ideal place, but is actually the only place
in py/ where it gets referenced, so is just right.
|
|
This file contains various MicroPython-specific helper functions, so isn't
good fit for lib/libc/.
|
|
|
|
|
|
|