diff options
Diffstat (limited to 'unix')
-rw-r--r-- | unix/main.c | 7 | ||||
-rw-r--r-- | unix/mpyconfig.h | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/unix/main.c b/unix/main.c index e3999db68b..f7b06d4f83 100644 --- a/unix/main.c +++ b/unix/main.c @@ -68,8 +68,11 @@ void do_repl() { line = line3; } } + py_lexer_t *lex = py_lexer_new_from_str_len("<stdin>", line, strlen(line), false); py_parse_node_t pn = py_parse(lex, PY_PARSE_SINGLE_INPUT); + py_lexer_free(lex); + if (pn != PY_PARSE_NODE_NULL) { //py_parse_node_show(pn, 0); bool comp_ok = py_compile(pn, true); @@ -111,6 +114,8 @@ void do_file(const char *file) { // compile py_parse_node_t pn = py_parse(lex, PY_PARSE_FILE_INPUT); + py_lexer_free(lex); + if (pn != PY_PARSE_NODE_NULL) { //printf("----------------\n"); //parse_node_show(pn, 0); @@ -118,8 +123,6 @@ void do_file(const char *file) { bool comp_ok = py_compile(pn, false); //printf("----------------\n"); - py_lexer_free(lex); - #if MICROPY_EMIT_CPYTHON if (!comp_ok) { printf("compile error\n"); diff --git a/unix/mpyconfig.h b/unix/mpyconfig.h index 587b09b16e..3ab17e6cab 100644 --- a/unix/mpyconfig.h +++ b/unix/mpyconfig.h @@ -1,7 +1,7 @@ // options to control how Micro Python is built #define MICROPY_ENABLE_FLOAT (1) -#define MICROPY_EMIT_CPYTHON (1) +#define MICROPY_EMIT_CPYTHON (0) #define MICROPY_EMIT_X64 (1) #define MICROPY_EMIT_THUMB (0) #define MICROPY_EMIT_INLINE_THUMB (0) |