Skip to content

Commit

Permalink
fix: evalToVar - do var lookup by name for strings
Browse files Browse the repository at this point in the history
  • Loading branch information
jbee committed Nov 29, 2023
1 parent bfcf7e6 commit ec30f4d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ fun interface Typed {
else value
}

fun isNonFractionValue(value: Number): Boolean {
private fun isNonFractionValue(value: Number): Boolean {
return value.toDouble() % 1.0 == 0.0
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ internal class Calculator(
}

private fun evalToVar(node: Node<*>): VariableValue? {
return eval(node, "Variable") { v: Any? -> v as VariableValue? }
return eval(node, "Variable") { v: Any? -> if (v is String) data.programRuleVariableValues[v] else v as VariableValue? }
}

private fun evalToMixed(nodes: Sequence<Node<*>>): List<*> {
Expand Down

0 comments on commit ec30f4d

Please sign in to comment.