Added xor (^) operator to constant expressions
This commit is contained in:
parent
364b08531b
commit
c6b3e619c3
2 changed files with 3 additions and 0 deletions
|
|
@ -203,6 +203,8 @@ func EvaluateExpression(expr string, lookup ConstantLookup) (int64, error) {
|
|||
result = result | nextVal
|
||||
case '&':
|
||||
result = result & nextVal
|
||||
case '^':
|
||||
result = result ^ nextVal
|
||||
default:
|
||||
return 0, fmt.Errorf("unknown operator %q", op)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -387,6 +387,7 @@ Evaluated strictly left to right:
|
|||
- `/` Division
|
||||
- `|` Bitwise OR
|
||||
- `&` Bitwise AND
|
||||
- `^` Bitwise XOR
|
||||
|
||||
### Constants
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue