diff options
Diffstat (limited to 'script')
-rw-r--r-- | script/vm/getDef.lua | 14 | ||||
-rw-r--r-- | script/vm/node/global.lua | 2 | ||||
-rw-r--r-- | script/vm/state.lua | 2 |
3 files changed, 16 insertions, 2 deletions
diff --git a/script/vm/getDef.lua b/script/vm/getDef.lua index d3c6c456..a28d093e 100644 --- a/script/vm/getDef.lua +++ b/script/vm/getDef.lua @@ -8,11 +8,25 @@ local simpleMap = util.switch() : case 'local' : call(function (source, results) results[#results+1] = source + if source.ref then + for _, ref in ipairs(source.ref) do + if ref.type == 'setlocal' then + results[#results+1] = ref + end + end + end end) : case 'getlocal' : case 'setlocal' : call(function (source, results) results[#results+1] = source.node + if source.node.ref then + for _, ref in ipairs(source.node.ref) do + if ref.type == 'setlocal' then + results[#results+1] = ref + end + end + end end) : getMap() diff --git a/script/vm/node/global.lua b/script/vm/node/global.lua index ebb06731..0e293ca3 100644 --- a/script/vm/node/global.lua +++ b/script/vm/node/global.lua @@ -46,7 +46,7 @@ end function mt:dropUri(uri) self.links[uri] = nil self.setsCache = nil - self.setsCache = nil + self.getsCache = nil end ---@return vm.node.global diff --git a/script/vm/state.lua b/script/vm/state.lua index 44b62684..87376952 100644 --- a/script/vm/state.lua +++ b/script/vm/state.lua @@ -38,7 +38,7 @@ end function m.dropUri(uri) local subscription = m.subscriptions[uri] m.subscriptions[uri] = nil - for name in pairs(subscription) do + for name in pairs(subscription.globals) do m.globals[name]:dropUri(uri) end end |