diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-09-07 10:55:43 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-09-07 10:55:43 +0300 |
commit | d4d1c45a553c6361a72053383f0fe242f05cad3d (patch) | |
tree | 55818ff6d2a20dc27a35781f149119f8832fa7f4 /py/runtime0.h | |
parent | 5c603bd0fd53e7dbd709883f289d1e580c86e33d (diff) |
py/runtime0.h: Move relational ops to the beginning of mp_binary_op_t.
This is to allow to encode arithmetic operations more efficiently, in
preparation to introduction of __rOP__ method support.
Diffstat (limited to 'py/runtime0.h')
-rw-r--r-- | py/runtime0.h | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/py/runtime0.h b/py/runtime0.h index 703c950f2..074dac1e4 100644 --- a/py/runtime0.h +++ b/py/runtime0.h @@ -54,6 +54,22 @@ typedef enum { } mp_unary_op_t; typedef enum { + // Relational operations, should return a bool + MP_BINARY_OP_LESS, + MP_BINARY_OP_MORE, + MP_BINARY_OP_EQUAL, + MP_BINARY_OP_LESS_EQUAL, + MP_BINARY_OP_MORE_EQUAL, + + MP_BINARY_OP_NOT_EQUAL, + MP_BINARY_OP_IN, + MP_BINARY_OP_IS, + MP_BINARY_OP_EXCEPTION_MATCH, + // these are not supported by the runtime and must be synthesised by the emitter + MP_BINARY_OP_NOT_IN, + MP_BINARY_OP_IS_NOT, + + // Arithmetic operations MP_BINARY_OP_OR, MP_BINARY_OP_XOR, MP_BINARY_OP_AND, @@ -83,21 +99,6 @@ typedef enum { MP_BINARY_OP_INPLACE_TRUE_DIVIDE, MP_BINARY_OP_INPLACE_MODULO, MP_BINARY_OP_INPLACE_POWER, - - // these should return a bool - MP_BINARY_OP_LESS, - MP_BINARY_OP_MORE, - MP_BINARY_OP_EQUAL, - MP_BINARY_OP_LESS_EQUAL, - MP_BINARY_OP_MORE_EQUAL, - - MP_BINARY_OP_NOT_EQUAL, - MP_BINARY_OP_IN, - MP_BINARY_OP_IS, - MP_BINARY_OP_EXCEPTION_MATCH, - // these are not supported by the runtime and must be synthesised by the emitter - MP_BINARY_OP_NOT_IN, - MP_BINARY_OP_IS_NOT, } mp_binary_op_t; typedef enum { |