summaryrefslogtreecommitdiffstatshomepage
path: root/qemu-arm/test_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'qemu-arm/test_main.c')
-rw-r--r--qemu-arm/test_main.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/qemu-arm/test_main.c b/qemu-arm/test_main.c
index cc4e15357e..d6fbfded6e 100644
--- a/qemu-arm/test_main.c
+++ b/qemu-arm/test_main.c
@@ -5,7 +5,6 @@
#include "py/nlr.h"
#include "py/obj.h"
-#include "py/parsehelper.h"
#include "py/compile.h"
#include "py/runtime0.h"
#include "py/runtime.h"
@@ -24,27 +23,11 @@ inline void do_str(const char *src) {
tt_abort_msg("Lexer initialization error");
}
- mp_parse_error_kind_t parse_error_kind;
- mp_parse_node_t pn = mp_parse(lex, MP_PARSE_FILE_INPUT, &parse_error_kind);
-
- if (pn == MP_PARSE_NODE_NULL) {
- mp_parse_show_exception(lex, parse_error_kind);
- mp_lexer_free(lex);
- tt_abort_msg("Parser error");
- }
-
- // parse okay
- qstr source_name = lex->source_name;
- mp_lexer_free(lex);
- mp_obj_t module_fun = mp_compile(pn, source_name, MP_EMIT_OPT_NONE, true);
-
- if (mp_obj_is_exception_instance(module_fun)) {
- mp_obj_print_exception(printf_wrapper, NULL, module_fun);
- tt_abort_msg("Compile error");
- }
-
nlr_buf_t nlr;
if (nlr_push(&nlr) == 0) {
+ qstr source_name = lex->source_name;
+ mp_parse_node_t pn = mp_parse(lex, MP_PARSE_FILE_INPUT);
+ mp_obj_t module_fun = mp_compile(pn, source_name, MP_EMIT_OPT_NONE, true);
mp_call_function_0(module_fun);
nlr_pop();
} else {