summaryrefslogtreecommitdiff
path: root/py/compile.c
diff options
context:
space:
mode:
authorTony DiCola <tony@tonydicola.com>2016-10-20 23:01:13 +0000
committerTony DiCola <tony@tonydicola.com>2016-10-20 23:01:13 +0000
commit00a44fa36cd1e35a438c4b89b5cef0bc82787c7a (patch)
tree4800a6984902e043e3fc437adcdfcd665f83e220 /py/compile.c
parent1f13f870b8f6554d9cd5570de221a6886e065b64 (diff)
parent3967ca7390ff8257728ef6237b93977b63bde41d (diff)
Merge remote-tracking branch 'micropython/master'
Conflicts: README.md - Kept Adafruit README.md intact. py/emitglue.c - Added xtensa architecture as an OR of the define. zephyr/README.md - Fixed spelling mistake.
Diffstat (limited to 'py/compile.c')
-rw-r--r--py/compile.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/py/compile.c b/py/compile.c
index 0ea8a3c15..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);
}
}
@@ -2836,12 +2829,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];