summaryrefslogtreecommitdiff
path: root/script/vm/global.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/vm/global.lua')
-rw-r--r--script/vm/global.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/script/vm/global.lua b/script/vm/global.lua
index 8df8b692..218e09db 100644
--- a/script/vm/global.lua
+++ b/script/vm/global.lua
@@ -15,6 +15,8 @@ mt.__index = mt
mt.type = 'global'
mt.name = ''
+local ID_SPLITE = '\x1F'
+
---@param uri uri
---@param source parser.object
function mt:addSet(uri, source)
@@ -93,6 +95,11 @@ function mt:getName()
return self.name
end
+---@return string
+function mt:getKeyName()
+ return self.name:match('[^' .. ID_SPLITE .. ']+$')
+end
+
---@return boolean
function mt:isAlive()
return next(self.links) ~= nil