| 1028 | |
| 1029 | |
| 1030 | static BinOpr getbinopr(int op) { |
| 1031 | switch (op) { |
| 1032 | case '+': return OPR_ADD; |
| 1033 | case '-': return OPR_SUB; |
| 1034 | case '*': return OPR_MUL; |
| 1035 | case '%': return OPR_MOD; |
| 1036 | case '^': return OPR_POW; |
| 1037 | case '/': return OPR_DIV; |
| 1038 | case TK_IDIV: return OPR_IDIV; |
| 1039 | case '&': return OPR_BAND; |
| 1040 | case '|': return OPR_BOR; |
| 1041 | case '~': return OPR_BXOR; |
| 1042 | case TK_SHL: return OPR_SHL; |
| 1043 | case TK_SHR: return OPR_SHR; |
| 1044 | case TK_CONCAT: return OPR_CONCAT; |
| 1045 | case TK_NE: return OPR_NE; |
| 1046 | case TK_EQ: return OPR_EQ; |
| 1047 | case '<': return OPR_LT; |
| 1048 | case TK_LE: return OPR_LE; |
| 1049 | case '>': return OPR_GT; |
| 1050 | case TK_GE: return OPR_GE; |
| 1051 | case TK_AND: return OPR_AND; |
| 1052 | case TK_OR: return OPR_OR; |
| 1053 | default: return OPR_NOBINOPR; |
| 1054 | } |
| 1055 | } |
| 1056 | |
| 1057 | |
| 1058 | static const struct { |