diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2023-01-10 21:07:48 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2023-01-10 21:07:48 +0800 |
commit | 5188c59384eee1b0a58b041f877c983788e9c3bf (patch) | |
tree | bbf545738acbd7fc6205392fd8b68440c283ff96 /script/vm/tracer.lua | |
parent | 709ec79260b448db181ea854d8288b334a812bb4 (diff) | |
download | lua-language-server-5188c59384eee1b0a58b041f877c983788e9c3bf.zip |
stash
Diffstat (limited to 'script/vm/tracer.lua')
-rw-r--r-- | script/vm/tracer.lua | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/script/vm/tracer.lua b/script/vm/tracer.lua index 65a329ca..a08d255c 100644 --- a/script/vm/tracer.lua +++ b/script/vm/tracer.lua @@ -97,11 +97,11 @@ function mt:collectLocal() self.assigns[#self.assigns+1] = self.source self.assignMap[self.source] = true - local varInfo = vm.getVariableInfoByName(self.source, self.name) + local variable = vm.getVariableInfoByCodeName(self.source, self.name) - assert(varInfo) + assert(variable) - for _, set in ipairs(varInfo.sets) do + for _, set in ipairs(variable.sets) do self.assigns[#self.assigns+1] = set self.assignMap[set] = true self:collectCare(set) @@ -110,7 +110,7 @@ function mt:collectLocal() end end - for _, get in ipairs(varInfo.gets) do + for _, get in ipairs(variable.gets) do self:collectCare(get) self.getMap[get] = true if get.finish > finishPos then @@ -831,14 +831,12 @@ function vm.traceNode(source) mode = 'global' name = base.global:getCodeName() else - base = vm.getVariableHead(source) - if not base then - return nil - end - name = vm.getVariableName(source) - if not name then + local variable = vm.getVariable(source) + if not variable then return nil end + base = variable.base + name = variable:getCodeName() mode = 'local' end local tracer = createTracer(mode, base, name) |