Réparation du hack sys.filter pour l'inversion

pull/138/head
mama 2017-11-15 16:37:04 +01:00
parent 0495965dc0
commit 3630d780d2
2 changed files with 4 additions and 4 deletions

View File

@ -432,8 +432,8 @@ let doInversion = (situationGate, parsedRules, r) => {
if (!inversion) return null
let { fixedObjectiveValue, fixedObjectiveRule } = inversion
let fx = x =>
evaluateNode(
n => (r.dottedName === n || n === 'sys.filter' ? x : situationGate(n)),
clearDict() && evaluateNode(
n => r.dottedName === n ? x : situationGate(n),
parsedRules,
fixedObjectiveRule
).nodeValue
@ -447,7 +447,7 @@ let doInversion = (situationGate, parsedRules, r) => {
inversionMissingVariables: collectNodeMissing(
evaluateNode(
n =>
r.dottedName === n || n === 'sys.filter' ? 1000 : situationGate(n),
r.dottedName === n ? 1000 : situationGate(n),
parsedRules,
fixedObjectiveRule
)

View File

@ -28,7 +28,7 @@ describe("inversions", () => {
})
it("should handle inversions", () => {
it("should handle simple inversion", () => {
let fakeState = { net: 2000 }
let stateSelector = name => fakeState[name]