diff options
Diffstat (limited to 'lcode.h')
-rw-r--r-- | lcode.h | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -24,19 +24,27 @@ | |||
24 | ** grep "ORDER OPR" if you change these enums (ORDER OP) | 24 | ** grep "ORDER OPR" if you change these enums (ORDER OP) |
25 | */ | 25 | */ |
26 | typedef enum BinOpr { | 26 | typedef enum BinOpr { |
27 | /* arithmetic operators */ | ||
27 | OPR_ADD, OPR_SUB, OPR_MUL, OPR_MOD, OPR_POW, | 28 | OPR_ADD, OPR_SUB, OPR_MUL, OPR_MOD, OPR_POW, |
28 | OPR_DIV, | 29 | OPR_DIV, OPR_IDIV, |
29 | OPR_IDIV, | 30 | /* bitwise operators */ |
30 | OPR_BAND, OPR_BOR, OPR_BXOR, | 31 | OPR_BAND, OPR_BOR, OPR_BXOR, |
31 | OPR_SHL, OPR_SHR, | 32 | OPR_SHL, OPR_SHR, |
33 | /* string operator */ | ||
32 | OPR_CONCAT, | 34 | OPR_CONCAT, |
35 | /* comparison operators */ | ||
33 | OPR_EQ, OPR_LT, OPR_LE, | 36 | OPR_EQ, OPR_LT, OPR_LE, |
34 | OPR_NE, OPR_GT, OPR_GE, | 37 | OPR_NE, OPR_GT, OPR_GE, |
38 | /* logical operators */ | ||
35 | OPR_AND, OPR_OR, | 39 | OPR_AND, OPR_OR, |
36 | OPR_NOBINOPR | 40 | OPR_NOBINOPR |
37 | } BinOpr; | 41 | } BinOpr; |
38 | 42 | ||
39 | 43 | ||
44 | /* true if operation is foldable (that is, it is arithmetic or bitwise) */ | ||
45 | #define foldbinop(op) ((op) <= OPR_SHR) | ||
46 | |||
47 | |||
40 | #define luaK_codeABC(fs,o,a,b,c) luaK_codeABCk(fs,o,a,b,c,0) | 48 | #define luaK_codeABC(fs,o,a,b,c) luaK_codeABCk(fs,o,a,b,c,0) |
41 | 49 | ||
42 | 50 | ||