diff options
Diffstat (limited to 'script/vm')
-rw-r--r-- | script/vm/runner.lua | 10 | ||||
-rw-r--r-- | script/vm/value.lua | 3 |
2 files changed, 10 insertions, 3 deletions
diff --git a/script/vm/runner.lua b/script/vm/runner.lua index dcfe83b2..36bab8bf 100644 --- a/script/vm/runner.lua +++ b/script/vm/runner.lua @@ -136,6 +136,7 @@ function mt:_lookIntoChild(action, topNode, outNode) if action.op.type == 'not' then outNode = outNode or topNode:copy() outNode, topNode = self:_lookIntoChild(action[1], topNode, outNode) + outNode = outNode:copy() end elseif action.type == 'binary' then if not action[1] or not action[2] then @@ -242,8 +243,13 @@ function mt:_lookIntoChild(action, topNode, outNode) mainNode = topNode:copy() end blockNode = self:_lookIntoBlock(action, blockNode:copy()) - if mainNode then - topNode = mainNode:merge(blockNode) + topNode = mainNode:merge(blockNode) + if action.filter then + -- look into filter again + guide.eachSource(action.filter, function (src) + self._mark[src] = nil + end) + blockNode, topNode = self:_lookIntoChild(action.filter, topNode:copy(), topNode:copy()) end elseif action.type == 'if' then local hasElse diff --git a/script/vm/value.lua b/script/vm/value.lua index bbae446c..7eab4a8e 100644 --- a/script/vm/value.lua +++ b/script/vm/value.lua @@ -23,7 +23,8 @@ function vm.testCondition(source) hasFalse = true end elseif n.type == 'global' and n.cate == 'type' then - if n.name == 'boolean' then + if n.name == 'boolean' + or n.name == 'unknown' then return nil end if n.name == 'false' |