diff options
Diffstat (limited to 'script')
-rw-r--r-- | script/vm/compiler.lua | 8 | ||||
-rw-r--r-- | script/vm/node.lua | 1 | ||||
-rw-r--r-- | script/vm/runner.lua | 8 |
3 files changed, 9 insertions, 8 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua index 70a46677..aa5ffb6e 100644 --- a/script/vm/compiler.lua +++ b/script/vm/compiler.lua @@ -567,7 +567,6 @@ local function matchCall(source) local newNode = myNode:copy() newNode:removeNode(needRemove) newNode:setData('originNode', myNode) - newNode:setData('hasResolved', true) vm.setNode(source, newNode, true) end end @@ -642,7 +641,7 @@ local function bindAs(source) local doc = ases[index] if doc and doc.touch == source.finish then local asNode = vm.compileNode(doc.as) - asNode:setData 'hasResolved' + asNode.resolved = true vm.setNode(source, asNode, true) return true end @@ -1207,7 +1206,7 @@ local compilerSwitch = util.switch() end compileLocal(source) - myNode:setData('hasResolved', true) + myNode.resolved = true end, function () local myNode = vm.getNode(source) ---@cast myNode -? @@ -1251,7 +1250,7 @@ local compilerSwitch = util.switch() return end vm.setNode(src, node, true) - node:setData('hasResolved', true) + node.resolved = true matchCall(src) end end) @@ -1978,5 +1977,6 @@ function vm.compileNode(source) local node = vm.getNode(source) ---@cast node -? + node.resolved = true return node end diff --git a/script/vm/node.lua b/script/vm/node.lua index c07269ab..58784d24 100644 --- a/script/vm/node.lua +++ b/script/vm/node.lua @@ -19,6 +19,7 @@ mt.id = 0 mt.type = 'vm.node' mt.optional = nil mt.data = nil +mt.resolved = nil ---@param node vm.node | vm.node.object ---@return vm.node diff --git a/script/vm/runner.lua b/script/vm/runner.lua index 13370ac7..8e264521 100644 --- a/script/vm/runner.lua +++ b/script/vm/runner.lua @@ -371,7 +371,7 @@ local function waitResolve(info) break end local node = vm.getNode(info.target) - if node and node:getData('hasResolved') then + if node and node.resolved then break end coroutine.yield() @@ -403,7 +403,7 @@ local function resolveDeadLock() local firstTarget = infos[1].target ---@cast firstTarget -? local firstNode = vm.setNode(firstTarget, vm.getNode(firstTarget):copy(), true) - firstNode:setData('hasResolved', true) + firstNode.resolved = true firstNode:setData('resolvedByDeadLock', true) end @@ -521,7 +521,7 @@ end ---@param source parser.object function vm.waitResolveRunner(source) local myNode = vm.getNode(source) - if myNode and myNode:getData('hasResolved') then + if myNode and myNode.resolved then return end @@ -555,7 +555,7 @@ end ---@param source parser.object function vm.storeWaitingRunner(source) local sourceNode = vm.getNode(source) - if sourceNode and sourceNode:getData 'hasResolved' then + if sourceNode and sourceNode.resolved then return end |