Precedence returns the operator precedence, where the higher the number indicates higher precedence operations.
(symbol string)
| 139 | // Precedence returns the operator precedence, where the higher the number indicates |
| 140 | // higher precedence operations. |
| 141 | func Precedence(symbol string) int { |
| 142 | op, found := operatorMap[symbol] |
| 143 | if !found { |
| 144 | return 0 |
| 145 | } |
| 146 | return op.precedence |
| 147 | } |
| 148 | |
| 149 | // Arity returns the number of argument the operator takes |
| 150 | // -1 is returned if an undefined symbol is provided |
no outgoing calls
no test coverage detected