diff options
| author | Paul Sokolovsky | 2015-01-16 01:38:10 +0200 |
|---|---|---|
| committer | Paul Sokolovsky | 2015-01-16 01:38:24 +0200 |
| commit | d7337f288e9411d8473c6c77aa35a00b50346ca7 (patch) | |
| tree | 166d5861a75ce76f4b98151845b9067d6c6380fd /minimal/main.c | |
| parent | 87bc8e2b3d66d3e87c2d01a7b3107a8ecce2a07f (diff) | |
minimal: Support even-driven REPL.
Diffstat (limited to 'minimal/main.c')
| -rw-r--r-- | minimal/main.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/minimal/main.c b/minimal/main.c index 29956c91a..d23d4d414 100644 --- a/minimal/main.c +++ b/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; |
