diff options
author | Damien George <damien.p.george@gmail.com> | 2018-02-24 23:03:17 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2018-02-24 23:03:17 +1100 |
commit | 7dfa56e40e9c343cbf4a1726a4babecc69a6b732 (patch) | |
tree | a21ea2af07f2a5135c0b9a633b5fce31a9a6e910 /py/compile.c | |
parent | 2ad555bc760833aae9991a4e6c893daa790c0c89 (diff) |
py/compile: Adjust c_assign_atom_expr() to use return instead of goto.
Makes the flow of the function a little more obvious, and allows to reach
100% coverage of compile.c when using gcov.
Diffstat (limited to 'py/compile.c')
-rw-r--r-- | py/compile.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/py/compile.c b/py/compile.c index 42ae8a829..9200b346b 100644 --- a/py/compile.c +++ b/py/compile.c @@ -376,6 +376,7 @@ STATIC void c_assign_atom_expr(compiler_t *comp, mp_parse_node_struct_t *pns, as EMIT(store_subscr); } } + return; } else if (MP_PARSE_NODE_STRUCT_KIND(pns1) == PN_trailer_period) { assert(MP_PARSE_NODE_IS_ID(pns1->nodes[0])); if (assign_kind == ASSIGN_AUG_LOAD) { @@ -387,16 +388,10 @@ STATIC void c_assign_atom_expr(compiler_t *comp, mp_parse_node_struct_t *pns, as } EMIT_ARG(store_attr, MP_PARSE_NODE_LEAF_ARG(pns1->nodes[0])); } - } else { - goto cannot_assign; + return; } - } else { - goto cannot_assign; } - return; - -cannot_assign: compile_syntax_error(comp, (mp_parse_node_t)pns, "can't assign to expression"); } |