diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-09-07 11:26:42 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-09-07 11:26:42 +0300 |
commit | 50b9329eba29a36b6948699aaea9473681d4f46b (patch) | |
tree | 6943c96745f9232b290835fcfa2c0ce6495107ff | |
parent | d4d1c45a553c6361a72053383f0fe242f05cad3d (diff) |
py/runtime0.h: Move MP_BINARY_OP_DIVMOD to the end of mp_binary_op_t.
It starts a dichotomy of mp_binary_op_t values which can't appear in the
bytecode. Another reason to move it is to VALUES of OP_* and OP_INPLACE_*
nicely adjacent. This also will be needed for OP_REVERSE_*, to be soon
introduced.
-rw-r--r-- | py/runtime0.h | 6 | ||||
-rw-r--r-- | tests/cmdline/cmd_showbc.py.exp | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/py/runtime0.h b/py/runtime0.h index 074dac1e4..fd497a6d1 100644 --- a/py/runtime0.h +++ b/py/runtime0.h @@ -84,7 +84,6 @@ typedef enum { MP_BINARY_OP_MODULO, MP_BINARY_OP_POWER, - MP_BINARY_OP_DIVMOD, // not emitted by the compiler but supported by the runtime MP_BINARY_OP_INPLACE_OR, MP_BINARY_OP_INPLACE_XOR, @@ -99,6 +98,11 @@ typedef enum { MP_BINARY_OP_INPLACE_TRUE_DIVIDE, MP_BINARY_OP_INPLACE_MODULO, MP_BINARY_OP_INPLACE_POWER, + + // Operations below this line don't appear in bytecode, they + // just identify special methods. + + MP_BINARY_OP_DIVMOD, // not emitted by the compiler but supported by the runtime } mp_binary_op_t; typedef enum { diff --git a/tests/cmdline/cmd_showbc.py.exp b/tests/cmdline/cmd_showbc.py.exp index 2dd927f74..0919aac53 100644 --- a/tests/cmdline/cmd_showbc.py.exp +++ b/tests/cmdline/cmd_showbc.py.exp @@ -132,7 +132,7 @@ Raw bytecode (code_info_size=\\d\+, bytecode_size=\\d\+): \\d\+ DUP_TOP_TWO \\d\+ LOAD_SUBSCR \\d\+ LOAD_FAST 12 -\\d\+ BINARY_OP 29 __iadd__ +\\d\+ BINARY_OP 28 __iadd__ \\d\+ ROT_THREE \\d\+ STORE_SUBSCR \\d\+ LOAD_DEREF 14 |