MCPcopy Create free account
hub / github.com/DFHack/dfhack / getbinopr

Function getbinopr

depends/lua/src/lparser.c:998–1023  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

996
997
998static BinOpr getbinopr (int op) {
999 switch (op) {
1000 case '+': return OPR_ADD;
1001 case '-': return OPR_SUB;
1002 case '*': return OPR_MUL;
1003 case '%': return OPR_MOD;
1004 case '^': return OPR_POW;
1005 case '/': return OPR_DIV;
1006 case TK_IDIV: return OPR_IDIV;
1007 case '&': return OPR_BAND;
1008 case '|': return OPR_BOR;
1009 case '~': return OPR_BXOR;
1010 case TK_SHL: return OPR_SHL;
1011 case TK_SHR: return OPR_SHR;
1012 case TK_CONCAT: return OPR_CONCAT;
1013 case TK_NE: return OPR_NE;
1014 case TK_EQ: return OPR_EQ;
1015 case '<': return OPR_LT;
1016 case TK_LE: return OPR_LE;
1017 case '>': return OPR_GT;
1018 case TK_GE: return OPR_GE;
1019 case TK_AND: return OPR_AND;
1020 case TK_OR: return OPR_OR;
1021 default: return OPR_NOBINOPR;
1022 }
1023}
1024
1025
1026static const struct {

Callers 1

subexprFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected