mirror of
https://github.com/GayPizzaSpecifications/pork.git
synced 2025-08-03 21:21:33 +00:00
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:
@ -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: "+"
|
||||
|
@ -19,6 +19,8 @@ enum class InfixOperator(val token: String) {
|
||||
Greater(">"),
|
||||
GreaterEqual(">="),
|
||||
LesserEqual("<="),
|
||||
BooleanAnd("and"),
|
||||
BooleanOr("or"),
|
||||
BinaryAnd("&"),
|
||||
BinaryOr("|"),
|
||||
BinaryExclusiveOr("^")
|
||||
|
@ -7,7 +7,7 @@ import kotlinx.serialization.Serializable
|
||||
@Serializable
|
||||
@SerialName("prefixOperator")
|
||||
enum class PrefixOperator(val token: String) {
|
||||
Negate("!"),
|
||||
BooleanNot("not"),
|
||||
UnaryPlus("+"),
|
||||
UnaryMinus("-"),
|
||||
BinaryNot("~")
|
||||
|
Reference in New Issue
Block a user