summaryrefslogtreecommitdiff
path: root/script/vm/node.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/vm/node.lua')
-rw-r--r--script/vm/node.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/script/vm/node.lua b/script/vm/node.lua
index 204a149d..d3e407b6 100644
--- a/script/vm/node.lua
+++ b/script/vm/node.lua
@@ -10,6 +10,7 @@ vm.nodeCache = {}
---@field [integer] vm.object
local mt = {}
mt.__index = mt
+mt.id = 0
mt.type = 'vm.node'
mt.optional = nil
mt.lastInfer = nil
@@ -273,11 +274,16 @@ function vm.clearNodeCache()
vm.nodeCache = {}
end
+local ID = 0
+
---@param a? vm.node | vm.object
---@param b? vm.node | vm.object
---@return vm.node
function vm.createNode(a, b)
- local node = setmetatable({}, mt)
+ ID = ID + 1
+ local node = setmetatable({
+ id = ID,
+ }, mt)
if a then
node:merge(a)
end