mirror of
https://github.com/micropython/micropython.git
synced 2026-01-07 20:50:14 +01:00
py: Implement basic with support in native emitter.
This commit is contained in:
@@ -1624,6 +1624,11 @@ STATIC void compile_with_stmt_helper(compiler_t *comp, int n, mp_parse_node_t *n
|
||||
compile_node(comp, body);
|
||||
} else {
|
||||
uint l_end = comp_next_label(comp);
|
||||
if (MICROPY_EMIT_NATIVE && comp->scope_cur->emit_options != MP_EMIT_OPT_BYTECODE) {
|
||||
// we need to allocate an extra label for the native emitter
|
||||
// it will use l_end+1 as an auxiliary label
|
||||
comp_next_label(comp);
|
||||
}
|
||||
if (MP_PARSE_NODE_IS_STRUCT_KIND(nodes[0], PN_with_item)) {
|
||||
// this pre-bit is of the form "a as b"
|
||||
mp_parse_node_struct_t *pns = (mp_parse_node_struct_t*)nodes[0];
|
||||
|
||||
Reference in New Issue
Block a user