katsaii / catspeak-lang

A cross-platform modding language for GameMaker games.
https://www.katsaii.com/catspeak-lang/
MIT License
81 stars 4 forks source link

Add `xor` operator #112

Closed katsaii closed 6 months ago

katsaii commented 8 months ago

What is your feature request?

Implement the logical xor operator in the Catspeak IR and Catspeak language.

Please describe in detail how you expect this new feature to behave.

For boolean types, xor is identical to !=. But because Catspeak is a weak dynamically typed language, a new xor operator should be implemented which first coerces "truthy" values and then compares them. I.e. 1 xor 2 should return False, whereas 1 != 2 would currently return True.