mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 20:20:14 +01:00
Implement: str.join, more float support, ROT_TWO in VM.
This commit is contained in:
9
py/vm.c
9
py/vm.c
@@ -32,7 +32,8 @@ py_obj_t py_execute_byte_code(const byte *code, const py_obj_t *args, uint n_arg
|
||||
// it shouldn't yield
|
||||
assert(0);
|
||||
}
|
||||
assert(sp == &state[17]);
|
||||
// TODO check fails if, eg, return from within for loop
|
||||
//assert(sp == &state[17]);
|
||||
return *sp;
|
||||
}
|
||||
|
||||
@@ -182,6 +183,12 @@ bool py_execute_byte_code_2(const byte *code, const byte **ip_in_out, py_obj_t *
|
||||
++sp;
|
||||
break;
|
||||
|
||||
case PYBC_ROT_TWO:
|
||||
obj1 = sp[0];
|
||||
sp[0] = sp[1];
|
||||
sp[1] = obj1;
|
||||
break;
|
||||
|
||||
case PYBC_ROT_THREE:
|
||||
obj1 = sp[0];
|
||||
sp[0] = sp[1];
|
||||
|
||||
Reference in New Issue
Block a user