language: add binary operators (#6)

- unary binary not
- infix bitwise and
- infix bitwise or
- infix bitwise exclusive or (xor)
This commit is contained in:
a dinosaur
2023-09-11 19:24:08 +10:00
committed by GitHub
parent d8c0ef43c1
commit 9ba150bb69
6 changed files with 67 additions and 12 deletions

View File

@ -18,5 +18,8 @@ enum class InfixOperator(val token: String) {
Lesser("<"),
Greater(">"),
GreaterEqual(">="),
LesserEqual("<=")
LesserEqual("<="),
BinaryAnd("&"),
BinaryOr("|"),
BinaryExclusiveOr("^")
}

View File

@ -9,5 +9,6 @@ import kotlinx.serialization.Serializable
enum class PrefixOperator(val token: String) {
Negate("!"),
UnaryPlus("+"),
UnaryMinus("-")
UnaryMinus("-"),
BinaryNot("~")
}