mirror of
https://github.com/irmen/prog8.git
synced 2024-06-01 06:41:42 +00:00
09c6cb4d6b
Fixed some slight bugs in library code
19 lines
539 B
Kotlin
19 lines
539 B
Kotlin
package prog8.code.core
|
|
|
|
val AssociativeOperators = setOf("+", "*", "&", "|", "^", "==", "!=")
|
|
val ComparisonOperators = setOf("==", "!=", "<", ">", "<=", ">=")
|
|
val LogicalOperators = setOf("and", "or", "xor", "not")
|
|
val BitwiseOperators = setOf("&", "|", "^", "~")
|
|
val PrefixOperators = setOf("+", "-", "~", "not")
|
|
|
|
fun invertedComparisonOperator(operator: String) =
|
|
when (operator) {
|
|
"==" -> "!="
|
|
"!=" -> "=="
|
|
"<" -> ">="
|
|
">" -> "<="
|
|
"<=" -> ">"
|
|
">=" -> "<"
|
|
else -> null
|
|
}
|