summaryrefslogtreecommitdiff
path: root/script/vm/tracer.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-12-16 17:59:28 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-12-16 17:59:28 +0800
commit4073e9e8bcdb5e48fd01f9f1fd14e2942a356ad0 (patch)
treedebe85a978f959f977862d3d07ecb7e5493f27dd /script/vm/tracer.lua
parent42ce9ab14839c83962268a94f6be8c6b36395270 (diff)
downloadlua-language-server-4073e9e8bcdb5e48fd01f9f1fd14e2942a356ad0.zip
fix
Diffstat (limited to 'script/vm/tracer.lua')
-rw-r--r--script/vm/tracer.lua23
1 files changed, 3 insertions, 20 deletions
diff --git a/script/vm/tracer.lua b/script/vm/tracer.lua
index b53fc33e..21a2619f 100644
--- a/script/vm/tracer.lua
+++ b/script/vm/tracer.lua
@@ -313,17 +313,7 @@ function mt:lookIntoChild(action, topNode, outNode)
or action.type == 'for'
or action.type == 'do' then
if action[1] then
- local actionStart
- if action.type == 'loop' then
- actionStart = action.keyword[4]
- elseif action.type == 'in' then
- actionStart = action.keyword[6]
- elseif action.type == 'repeat'
- or action.type == 'for'
- or action.type == 'do' then
- actionStart = action.keyword[2]
- end
- self:lookIntoBlock(action, actionStart, topNode:copy())
+ self:lookIntoBlock(action, action.bstart, topNode:copy())
local lastAssign = self:getLastAssign(action.start, action.finish)
if lastAssign then
self:getNode(lastAssign)
@@ -341,7 +331,7 @@ function mt:lookIntoChild(action, topNode, outNode)
mainNode = topNode:copy()
end
if action[1] then
- self:lookIntoBlock(action, action.keyword[4], blockNode:copy())
+ self:lookIntoBlock(action, action.bstart, blockNode:copy())
local lastAssign = self:getLastAssign(action.start, action.finish)
if lastAssign then
self:getNode(lastAssign)
@@ -372,14 +362,7 @@ function mt:lookIntoChild(action, topNode, outNode)
end
local mergedNode
if subBlock[1] then
- local actionStart
- if subBlock.type == 'ifblock'
- or subBlock.type == 'elseif' then
- actionStart = subBlock.keyword[4]
- else
- actionStart = subBlock.keyword[2]
- end
- self:lookIntoBlock(subBlock, actionStart, blockNode:copy())
+ self:lookIntoBlock(subBlock, subBlock.bstart, blockNode:copy())
local neverReturn = subBlock.hasReturn
or subBlock.hasGoTo
or subBlock.hasBreak