diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-07-11 17:45:39 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-07-11 17:45:39 +0800 |
commit | 41f0744c4e601ec80e63cce15b6e50f02f6e4a71 (patch) | |
tree | 7f42eaa2e162578db943eef9fce74580c08f766d /script/vm | |
parent | 2abeaaf81dd8c288a27a2c9638bf5b527ece3463 (diff) | |
download | lua-language-server-41f0744c4e601ec80e63cce15b6e50f02f6e4a71.zip |
fix #1320
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' |