From e49153fb98ade48395b80271093bd763e771b3da Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 11 Oct 2016 12:29:54 +1100 Subject: py/compile: Remove unreachable code. --- py/compile.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'py/compile.c') diff --git a/py/compile.c b/py/compile.c index 0ea8a3c15..de75bcdc3 100644 --- a/py/compile.c +++ b/py/compile.c @@ -2836,12 +2836,10 @@ STATIC void compile_scope_func_annotations(compiler_t *comp, mp_parse_node_t pn) // no annotation return; } - } else if (MP_PARSE_NODE_STRUCT_KIND(pns) == PN_typedargslist_dbl_star) { + } else { + assert(MP_PARSE_NODE_STRUCT_KIND(pns) == PN_typedargslist_dbl_star); // double star with possible annotation // fallthrough - } else { - // no annotation - return; } mp_parse_node_t pn_annotation = pns->nodes[1]; -- cgit v1.2.3 From deaa57acf3db104e2c1a54c6bf4bbd96f95583f4 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 12 Oct 2016 10:20:48 +1100 Subject: py/compile: Remove debugging code for compiler dispatch. It was a relic from the days of developing the compiler and is no longer needed, and it's impossible to trigger via a test. --- py/compile.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'py/compile.c') diff --git a/py/compile.c b/py/compile.c index de75bcdc3..f84d5e214 100644 --- a/py/compile.c +++ b/py/compile.c @@ -2723,15 +2723,8 @@ STATIC void compile_node(compiler_t *comp, mp_parse_node_t pn) { mp_parse_node_struct_t *pns = (mp_parse_node_struct_t*)pn; EMIT_ARG(set_source_line, pns->source_line); compile_function_t f = compile_function[MP_PARSE_NODE_STRUCT_KIND(pns)]; - if (f == NULL) { -#if MICROPY_DEBUG_PRINTERS - printf("node %u cannot be compiled\n", (uint)MP_PARSE_NODE_STRUCT_KIND(pns)); - mp_parse_node_print(pn, 0); -#endif - compile_syntax_error(comp, pn, "internal compiler error"); - } else { - f(comp, pns); - } + assert(f != NULL); + f(comp, pns); } } -- cgit v1.2.3