diff options
| author | Damien George <damien.p.george@gmail.com> | 2017-02-27 15:09:15 +1100 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2017-02-27 15:09:15 +1100 |
| commit | ad81a2e6cf349cba514e73dc4fe18b1d512b7ce4 (patch) | |
| tree | 37cb0aa48de7a3163bd97fb15dd07b426d744f48 /minimal/main.c | |
| parent | 3b2fd4df31fad39b66eadefc2b95b143c1b67add (diff) | |
minimal: Add ability and description to build without the compiler.
Diffstat (limited to 'minimal/main.c')
| -rw-r--r-- | minimal/main.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/minimal/main.c b/minimal/main.c index 5e104e7e8..6b77b1a42 100644 --- a/minimal/main.c +++ b/minimal/main.c @@ -9,6 +9,7 @@ #include "py/gc.h" #include "lib/utils/pyexec.h" +#if MICROPY_ENABLE_COMPILER void do_str(const char *src, mp_parse_input_kind_t input_kind) { mp_lexer_t *lex = mp_lexer_new_from_str_len(MP_QSTR__lt_stdin_gt_, src, strlen(src), 0); if (lex == NULL) { @@ -28,6 +29,7 @@ void do_str(const char *src, mp_parse_input_kind_t input_kind) { mp_obj_print_exception(&mp_plat_print, (mp_obj_t)nlr.ret_val); } } +#endif static char *stack_top; static char heap[2048]; @@ -40,6 +42,7 @@ int main(int argc, char **argv) { gc_init(heap, heap + sizeof(heap)); #endif mp_init(); + #if MICROPY_ENABLE_COMPILER #if MICROPY_REPL_EVENT_DRIVEN pyexec_event_repl_init(); for (;;) { @@ -53,6 +56,9 @@ int main(int argc, char **argv) { #endif //do_str("print('hello world!', list(x+1 for x in range(10)), end='eol\\n')", MP_PARSE_SINGLE_INPUT); //do_str("for i in range(10):\r\n print(i)", MP_PARSE_FILE_INPUT); + #else + pyexec_frozen_module("frozentest.py"); + #endif mp_deinit(); return 0; } |
