diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-01-03 02:48:56 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-01-04 02:35:48 +0200 |
commit | ded0a1efa5744235fbb4cd07c96598018a3661eb (patch) | |
tree | 35ed1ff0d68c42c607d66d6b04566e22e8be5e60 /py | |
parent | 1c6de11f772afae9b4155f8a654cadd05125a2de (diff) | |
download | micropython-ded0a1efa5744235fbb4cd07c96598018a3661eb.tar.gz micropython-ded0a1efa5744235fbb4cd07c96598018a3661eb.zip |
Implement BUILD_SLICE opcode (2-arg version).
Diffstat (limited to 'py')
-rw-r--r-- | py/vm.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -410,6 +410,18 @@ bool mp_execute_byte_code_2(const byte **ip_in_out, mp_obj_t *fastn, mp_obj_t ** sp++; break; + case MP_BC_BUILD_SLICE: + DECODE_UINT; + if (unum == 2) { + obj2 = POP(); + obj1 = TOP(); + SET_TOP(mp_obj_new_slice(obj1, obj2, NULL)); + } else { + printf("3-argument slice is not supported\n"); + assert(0); + } + break; + case MP_BC_UNPACK_SEQUENCE: DECODE_UINT; rt_unpack_sequence(sp[0], unum, sp - unum + 1); |