🐛 Corrige la régression introduite par d9f6515d15

pull/18/head
Laurent Bossavit 2017-07-03 16:05:46 +02:00
parent f36cceaf2c
commit f53b06a5eb
1 changed files with 6 additions and 4 deletions

View File

@ -69,10 +69,12 @@ let fillVariableNode = (rules, rule, situationGate) => (parseResult) => {
),
situationValue = evaluateVariable(situationGate, dottedName, variable),
calculatedValue = variableIsCalculable ? parsedRule.nodeValue : null,
systemValue = dottedName.startsWith("sys .") ? variable.nodeValue : null,
nodeValue = R.defaultTo(situationValue,
R.defaultTo(systemValue,calculatedValue)),
nodeValue2 = situationValue
!= null ? situationValue
: !variableIsCalculable
? null
: parsedRule.nodeValue,
nodeValue = dottedName.startsWith("sys .") ? variable.nodeValue : nodeValue2,
explanation = parsedRule,
missingVariables = variableIsCalculable ? [] : (nodeValue == null ? [dottedName] : [])