py, readline: Add tab autocompletion for REPL.

Can complete names in the global namespace, as well as a chain of
attributes, eg pyb.Pin.board.<tab> will give a list of all board pins.

Costs 700 bytes ROM on Thumb2 arch, but greatly increases usability of
REPL prompt.
This commit is contained in:
Damien George
2015-04-26 17:55:31 +01:00
parent b7a4f15b34
commit a1a2c411b2
3 changed files with 167 additions and 1 deletions

View File

@@ -28,9 +28,11 @@
#include "py/mpconfig.h"
#include "py/misc.h"
#include "py/mpprint.h"
#if MICROPY_HELPER_REPL
bool mp_repl_continue_with_input(const char *input);
mp_uint_t mp_repl_autocomplete(const char *str, mp_uint_t len, const mp_print_t *print, const char **compl_str);
#endif
#endif // __MICROPY_INCLUDED_PY_REPL_H__