fix bug in evaluating logical expressions if one of the operands was not boolean 1 or 0

This commit is contained in:
Irmen de Jong
2021-02-14 18:24:31 +01:00
parent 62dda4d891
commit 1e3930aae2
4 changed files with 51 additions and 5 deletions

View File

@@ -13,6 +13,8 @@ import kotlin.math.abs
val associativeOperators = setOf("+", "*", "&", "|", "^", "or", "and", "xor", "==", "!=")
val comparisonOperators = setOf("==", "!=", "<", ">", "<=", ">=")
val augmentAssignmentOperators = setOf("+", "-", "/", "*", "**", "&", "|", "^", "<<", ">>", "%", "and", "or", "xor")
val logicalOperators = setOf("and", "or", "xor", "not")
sealed class Expression: Node {
abstract fun constValue(program: Program): NumericLiteralValue?