From 3ac5243deae7d07fb7febcc154ed33320f6e873b Mon Sep 17 00:00:00 2001 From: Laurent Bossavit Date: Thu, 13 Jul 2017 12:12:19 +0200 Subject: [PATCH] =?UTF-8?q?:gear:=20Evaluations=20diff=C3=A9r=C3=A9es=20(n?= =?UTF-8?q?=C3=A9gation=20de=20variable)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/engine/traverse.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/source/engine/traverse.js b/source/engine/traverse.js index 0fd96a025..000893dd8 100644 --- a/source/engine/traverse.js +++ b/source/engine/traverse.js @@ -114,16 +114,26 @@ let createVariableNode = (rules, rule, situationGate) => (parseResult) => { let buildNegatedVariable = variable => { - let nodeValue = variable.nodeValue == null ? null : !variable.nodeValue + let evaluate = (situation, parsedRules, node) => { + let explanation = evaluateNode(situationGate, parsedRules, node.explanation), + nodeValue = explanation.nodeValue == null ? null : !explanation.nodeValue + let collectMissing = node => collectNodeMissing(node.explanation) + return { + ...node, + nodeValue, + collectMissing, + explanation, + jsx: R.assocPath(["props","value"],nodeValue,node.jsx) + } + } + return { - nodeValue, category: 'mecanism', name: 'négation', type: 'boolean', explanation: variable, jsx: ¬