Browse Source

minimal: Support even-driven REPL.

pull/1072/head
Paul Sokolovsky 10 years ago
parent
commit
d7337f288e
  1. 10
      minimal/main.c
  2. 1
      minimal/mpconfigport.h

10
minimal/main.c

@ -60,7 +60,17 @@ int main(int argc, char **argv) {
gc_init(heap, heap + sizeof(heap));
#endif
mp_init();
#if MICROPY_REPL_EVENT_DRIVEN
pyexec_friendly_repl_init();
for (;;) {
int c = stdin_rx_chr();
if (pyexec_friendly_repl_process_char(c)) {
break;
}
}
#else
pyexec_friendly_repl();
#endif
//do_str("print('hello world!', list(x+1 for x in range(10)), end='eol\\n')");
mp_deinit();
return 0;

1
minimal/mpconfigport.h

@ -11,6 +11,7 @@
#define MICROPY_MEM_STATS (0)
#define MICROPY_DEBUG_PRINTERS (0)
#define MICROPY_ENABLE_GC (1)
#define MICROPY_REPL_EVENT_DRIVEN (0)
#define MICROPY_HELPER_REPL (1)
#define MICROPY_HELPER_LEXER_UNIX (0)
#define MICROPY_ENABLE_SOURCE_LINE (0)

Loading…
Cancel
Save