diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-06-15 15:25:38 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-06-15 15:25:38 +0800 |
commit | 98fe538e564bac10e5df65c31e20b8dc3317e87d (patch) | |
tree | 08fa752ef06ed64c7bfe7358115e1bc6fb6e4b85 /script | |
parent | ed2fd90278a6e913186ddfbbb8939733c640102b (diff) | |
download | lua-language-server-98fe538e564bac10e5df65c31e20b8dc3317e87d.zip |
fix
Diffstat (limited to 'script')
-rw-r--r-- | script/vm/runner.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/script/vm/runner.lua b/script/vm/runner.lua index a9c38a87..e7851b49 100644 --- a/script/vm/runner.lua +++ b/script/vm/runner.lua @@ -114,6 +114,9 @@ end ---@param outNode? vm.node ---@return vm.node function mt:_lookInto(action, topNode, outNode) + if not action then + return topNode, outNode + end local set local value = vm.getObjectValue(action) if value then @@ -128,7 +131,9 @@ function mt:_lookInto(action, topNode, outNode) self:_launchBlock(action, topNode:copy()) elseif action.type == 'while' then local blockNode, mainNode = self:_lookInto(action.filter, topNode:copy(), topNode:copy()) - self:_fastWard(action.filter.finish, blockNode) + if action.filter then + self:_fastWard(action.filter.finish, blockNode) + end self:_launchBlock(action, blockNode:copy()) topNode = mainNode elseif action.type == 'if' then @@ -201,7 +206,7 @@ function mt:_lookInto(action, topNode, outNode) end end if loc then - self:_fastWard(loc.finish, topNode) + self:_fastWard(loc.finish, topNode:copy()) if guide.isLiteral(checker) then local checkerNode = vm.compileNode(checker) if action.op.type == '==' then |