numbat icon indicating copy to clipboard operation
numbat copied to clipboard

Implement bitwise operators

Open rehelmin opened this issue 5 months ago • 4 comments

The code in this pull request adds implementations for the following bitwise operators:

  • And
  • Or
  • Xor
  • Not
  • Bit shift left
  • Bit shift right

Note that typically used '^' character for xor currently clashes with the power operator in numbat, so I have used the more cumbersome to type, but unique ⨁ character for performing the xor operation.

rehelmin avatar Jul 13 '25 17:07 rehelmin

Note that typically used '^' character for xor currently clashes with the power operator in numbat, so I have used the more cumbersome to type, but unique ⨁ character for performing the xor operation.

That sounds like a reasonable solution. I think it would be good, having an xor keyword in addition, to make it less cumbersome.

Goju-Ryu avatar Jul 14 '25 21:07 Goju-Ryu

Updated. I'm not sure why all the builds are all failing now though? I'm able to build it just fine on my workstation.

rehelmin avatar Jul 16 '25 01:07 rehelmin

Thank you. I think the failing builds are related to #752. It should be an easy fix, which I can look into tonight.

Goju-Ryu avatar Jul 16 '25 06:07 Goju-Ryu

I fixed the error, added documentation and updated the add-in. I also changed the tokenizer implementation slightly to use the keywords map instead of custom parsing for the xor keyword.

Goju-Ryu avatar Jul 16 '25 22:07 Goju-Ryu