diff options
author | Petr Viktorin <encukou@gmail.com> | 2019-09-25 17:11:56 +0200 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-11-21 12:13:11 +1100 |
commit | 57c18fdd386064387a19271a3dbd3182ee5c44b0 (patch) | |
tree | 4f28cc7316c0c253efb1bfa3e19d347823024b04 /py/compile.c | |
parent | 2679c9e11608bb37360008ebed7336f8a231d09d (diff) |
py/compile: Coalesce error message for break/continue outside loop.
To reduce code size.
Diffstat (limited to 'py/compile.c')
-rw-r--r-- | py/compile.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/py/compile.c b/py/compile.c index 2c818a934..0d36aef8b 100644 --- a/py/compile.c +++ b/py/compile.c @@ -1028,16 +1028,13 @@ STATIC void compile_del_stmt(compiler_t *comp, mp_parse_node_struct_t *pns) { STATIC void compile_break_cont_stmt(compiler_t *comp, mp_parse_node_struct_t *pns) { uint16_t label; - const char *error_msg; if (MP_PARSE_NODE_STRUCT_KIND(pns) == PN_break_stmt) { label = comp->break_label; - error_msg = "'break' outside loop"; } else { label = comp->continue_label; - error_msg = "'continue' outside loop"; } if (label == INVALID_LABEL) { - compile_syntax_error(comp, (mp_parse_node_t)pns, error_msg); + compile_syntax_error(comp, (mp_parse_node_t)pns, "'break'/'continue' outside loop"); } assert(comp->cur_except_level >= comp->break_continue_except_level); EMIT_ARG(unwind_jump, label, comp->cur_except_level - comp->break_continue_except_level); |