language: add boolean and/or operators, change negation syntax (#7)

* language: add boolean and/or operators, change negation syntax

* examples: simplify row builder using arrays
This commit is contained in:
a dinosaur
2023-09-12 04:02:58 +10:00
committed by GitHub
parent 0aab45094a
commit a07e0fe672
7 changed files with 65 additions and 11 deletions

View File

@ -96,6 +96,12 @@ types:
- name: LesserEqual
values:
token: "<="
- name: BooleanAnd
values:
token: "and"
- name: BooleanOr
values:
token: "or"
- name: BinaryAnd
values:
token: "&"
@ -196,9 +202,9 @@ types:
- name: token
type: String
enums:
- name: Negate
- name: BooleanNot
values:
token: "!"
token: "not"
- name: UnaryPlus
values:
token: "+"

View File

@ -19,6 +19,8 @@ enum class InfixOperator(val token: String) {
Greater(">"),
GreaterEqual(">="),
LesserEqual("<="),
BooleanAnd("and"),
BooleanOr("or"),
BinaryAnd("&"),
BinaryOr("|"),
BinaryExclusiveOr("^")

View File

@ -7,7 +7,7 @@ import kotlinx.serialization.Serializable
@Serializable
@SerialName("prefixOperator")
enum class PrefixOperator(val token: String) {
Negate("!"),
BooleanNot("not"),
UnaryPlus("+"),
UnaryMinus("-"),
BinaryNot("~")