summaryrefslogtreecommitdiff
path: root/script/vm/local-id.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/vm/local-id.lua')
-rw-r--r--script/vm/local-id.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/script/vm/local-id.lua b/script/vm/local-id.lua
new file mode 100644
index 00000000..f19e85e6
--- /dev/null
+++ b/script/vm/local-id.lua
@@ -0,0 +1,21 @@
+local util = require 'utility'
+
+---@class parser.object
+---@field _localID string
+
+local compileMap = util.switch()
+ : getMap()
+
+local m = {}
+
+m.ID_SPLITE = '\x1F'
+
+function m.getID(source)
+ local compiler = compileMap[source.type]
+ if compiler then
+ return compiler(source)
+ end
+ return false
+end
+
+return m