Added xor (^) operator to constant expressions

This commit is contained in:
Mattias Hansson 2025-11-20 22:01:23 +01:00
parent 364b08531b
commit c6b3e619c3
2 changed files with 3 additions and 0 deletions

View file

@ -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)
}

View file

@ -387,6 +387,7 @@ Evaluated strictly left to right:
- `/` Division
- `|` Bitwise OR
- `&` Bitwise AND
- `^` Bitwise XOR
### Constants