mirror of
https://github.com/GayPizzaSpecifications/pork.git
synced 2025-08-03 21:21:33 +00:00
language: add binary operators (#6)
- unary binary not - infix bitwise and - infix bitwise or - infix bitwise exclusive or (xor)
This commit is contained in:
@ -96,6 +96,15 @@ types:
|
||||
- name: LesserEqual
|
||||
values:
|
||||
token: "<="
|
||||
- name: BinaryAnd
|
||||
values:
|
||||
token: "&"
|
||||
- name: BinaryOr
|
||||
values:
|
||||
token: "|"
|
||||
- name: BinaryExclusiveOr
|
||||
values:
|
||||
token: "^"
|
||||
InfixOperation:
|
||||
parent: Expression
|
||||
values:
|
||||
@ -196,6 +205,9 @@ types:
|
||||
- name: UnaryMinus
|
||||
values:
|
||||
token: "-"
|
||||
- name: BinaryNot
|
||||
values:
|
||||
token: "~"
|
||||
PrefixOperation:
|
||||
parent: Expression
|
||||
values:
|
||||
|
@ -18,5 +18,8 @@ enum class InfixOperator(val token: String) {
|
||||
Lesser("<"),
|
||||
Greater(">"),
|
||||
GreaterEqual(">="),
|
||||
LesserEqual("<=")
|
||||
LesserEqual("<="),
|
||||
BinaryAnd("&"),
|
||||
BinaryOr("|"),
|
||||
BinaryExclusiveOr("^")
|
||||
}
|
||||
|
@ -9,5 +9,6 @@ import kotlinx.serialization.Serializable
|
||||
enum class PrefixOperator(val token: String) {
|
||||
Negate("!"),
|
||||
UnaryPlus("+"),
|
||||
UnaryMinus("-")
|
||||
UnaryMinus("-"),
|
||||
BinaryNot("~")
|
||||
}
|
||||
|
Reference in New Issue
Block a user