mirror of
https://github.com/GayPizzaSpecifications/pork.git
synced 2025-09-18 08:31:32 +00:00
evaluator: fix unary operators on floating point types always throwing a spurious error (#9)
This commit is contained in:
@ -117,7 +117,7 @@ class EvaluationVisitor(root: Scope) : NodeVisitor<Any> {
|
|||||||
convert = { it.toDouble() },
|
convert = { it.toDouble() },
|
||||||
plus = { +it },
|
plus = { +it },
|
||||||
minus = { -it },
|
minus = { -it },
|
||||||
binaryNot = unaryFloatingPointTypeError("binary not")
|
binaryNot = { unaryFloatingPointTypeError("binary not") }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
is Float -> {
|
is Float -> {
|
||||||
@ -127,7 +127,7 @@ class EvaluationVisitor(root: Scope) : NodeVisitor<Any> {
|
|||||||
convert = { it.toFloat() },
|
convert = { it.toFloat() },
|
||||||
plus = { +it },
|
plus = { +it },
|
||||||
minus = { -it },
|
minus = { -it },
|
||||||
binaryNot = unaryFloatingPointTypeError("binary not")
|
binaryNot = { unaryFloatingPointTypeError("binary not") }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
is Long -> {
|
is Long -> {
|
||||||
|
Reference in New Issue
Block a user