dynamicexpresso / DynamicExpresso

C# expressions interpreter
http://dynamic-expresso.azurewebsites.net/
MIT License
1.91k stars 364 forks source link

Bitwise complement operator ~ #261

Closed rkaderli closed 1 year ago

rkaderli commented 1 year ago

I have expression using [Flags]enum type where I would like to reset a bit using like "b = ~a;"

See also https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators#bitwise-complement-operator-

Is there a way to get this done? opposite operation with | works just fine.

metoule commented 1 year ago

I forgot to handle the unary operators in #237 ... It should be pretty straightforward to implement.