diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-06-21 21:05:37 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-06-21 21:05:37 +0800 |
commit | 6aea81f55c385ba167119a7faeca3a143eedc1ec (patch) | |
tree | c2073352b230abe3976ee9a3f406635d546087af /script/vm | |
parent | 317bced17780ebdeed67ed17590b7e2598b2b55a (diff) | |
download | lua-language-server-6aea81f55c385ba167119a7faeca3a143eedc1ec.zip |
fix
Diffstat (limited to 'script/vm')
-rw-r--r-- | script/vm/compiler.lua | 17 | ||||
-rw-r--r-- | script/vm/runner.lua | 3 |
2 files changed, 13 insertions, 7 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua index ff1e3a15..6c5f2b17 100644 --- a/script/vm/compiler.lua +++ b/script/vm/compiler.lua @@ -1290,10 +1290,8 @@ local compilerSwitch = util.switch() end return vm.getNode(src) elseif src.type == 'getlocal' then - if bindAs(src) then - return - end - vm.setNode(src, node, true) + src._runnerNode = node + vm.removeNode(src) end end) @@ -1316,7 +1314,12 @@ local compilerSwitch = util.switch() if bindAs(source) then return end - vm.compileNode(source.node) + if not source._runnerNode then + vm.compileNode(source.node) + end + if source._runnerNode then + vm.setNode(source, source._runnerNode) + end end) : case 'setfield' : case 'setmethod' @@ -1850,7 +1853,9 @@ local function compileByCall(source) end end if needRemove then - myNode:removeNode(needRemove) + local newNode = myNode:copy() + newNode:removeNode(needRemove) + vm.setNode(source, newNode, true) end end diff --git a/script/vm/runner.lua b/script/vm/runner.lua index 3ee718b3..acf5427d 100644 --- a/script/vm/runner.lua +++ b/script/vm/runner.lua @@ -351,5 +351,6 @@ function vm.launchRunner(loc, callback) return end - self:_launchBlock(guide.getParentBlock(loc), vm.getNode(loc):copy()) + local topNode = self:_launchBlock(guide.getParentBlock(loc), vm.getNode(loc):copy()) + self:_fastWard(math.maxinteger, topNode) end |