diff options
author | Damien George <damien.p.george@gmail.com> | 2014-04-17 22:10:53 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-04-17 22:10:53 +0100 |
commit | 729f7b42d65c016c9d5f27fb8a8122869f06c129 (patch) | |
tree | 8d8d8c2a89ff9011b06650c256a2d5f2458c930c /py/emitcpy.c | |
parent | de7c425139c92745280b62f7ebb756def96d072a (diff) | |
download | micropython-729f7b42d65c016c9d5f27fb8a8122869f06c129.tar.gz micropython-729f7b42d65c016c9d5f27fb8a8122869f06c129.zip |
py: Merge BINARY_OP_SUBSCR and store_subscr (w/ delete) into subscr.
mp_obj_t->subscr now does load/store/delete.
Diffstat (limited to 'py/emitcpy.c')
-rw-r--r-- | py/emitcpy.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/py/emitcpy.c b/py/emitcpy.c index 010219d12f..119cf818cf 100644 --- a/py/emitcpy.c +++ b/py/emitcpy.c @@ -281,6 +281,13 @@ STATIC void emit_cpy_load_build_class(emit_t *emit) { } } +STATIC void emit_cpy_load_subscr(emit_t *emit) { + emit_pre(emit, -1, 1); + if (emit->pass == PASS_3) { + printf("BINARY_SUBSCR\n"); + } +} + STATIC void emit_cpy_store_fast(emit_t *emit, qstr qstr, int local_num) { emit_pre(emit, -1, 3); if (emit->pass == PASS_3) { @@ -555,7 +562,6 @@ STATIC void emit_cpy_binary_op(emit_t *emit, mp_binary_op_t op) { } if (emit->pass == PASS_3) { switch (op) { - case MP_BINARY_OP_SUBSCR: printf("BINARY_SUBSCR\n"); break; case MP_BINARY_OP_OR: printf("BINARY_OR\n"); break; case MP_BINARY_OP_XOR: printf("BINARY_XOR\n"); break; case MP_BINARY_OP_AND: printf("BINARY_AND\n"); break; @@ -817,6 +823,7 @@ const emit_method_table_t emit_cpython_method_table = { emit_cpy_load_attr, emit_cpy_load_method, emit_cpy_load_build_class, + emit_cpy_load_subscr, emit_cpy_store_fast, emit_cpy_store_deref, emit_cpy_store_name, |