diff options
Diffstat (limited to 'script/vm')
-rw-r--r-- | script/vm/getDef.lua | 14 | ||||
-rw-r--r-- | script/vm/global-manager.lua (renamed from script/vm/global-node.lua) | 2 | ||||
-rw-r--r-- | script/vm/init.lua | 2 | ||||
-rw-r--r-- | script/vm/literal-manager.lua (renamed from script/vm/literal-node.lua) | 0 | ||||
-rw-r--r-- | script/vm/manager.lua (renamed from script/vm/state.lua) | 14 | ||||
-rw-r--r-- | script/vm/node/compiler.lua | 14 | ||||
-rw-r--r-- | script/vm/node/union.lua | 4 |
7 files changed, 25 insertions, 25 deletions
diff --git a/script/vm/getDef.lua b/script/vm/getDef.lua index df180420..6cc6bf85 100644 --- a/script/vm/getDef.lua +++ b/script/vm/getDef.lua @@ -1,10 +1,10 @@ ---@class vm -local vm = require 'vm.vm' -local util = require 'utility' -local compiler = require 'vm.node.compiler' -local guide = require 'parser.guide' -local localID = require 'vm.local-id' -local globalNode = require 'vm.global-node' +local vm = require 'vm.vm' +local util = require 'utility' +local compiler = require 'vm.node.compiler' +local guide = require 'parser.guide' +local localID = require 'vm.local-id' +local globalMgr = require 'vm.global-manager' local simpleMap @@ -115,7 +115,7 @@ end ---@param source parser.object ---@param pushResult fun(src: parser.object) local function searchByGlobal(source, pushResult) - local global = globalNode.getNode(source) + local global = globalMgr.getNode(source) if not global then return end diff --git a/script/vm/global-node.lua b/script/vm/global-manager.lua index 6235ff6b..db037c32 100644 --- a/script/vm/global-node.lua +++ b/script/vm/global-manager.lua @@ -5,7 +5,7 @@ local globalBuilder = require 'vm.node.global' ---@class parser.object ---@field _globalNode vm.node.global ----@class vm.global-node +---@class vm.global-manager local m = {} ---@type table<string, vm.node.global> m.globals = util.defaultTable(globalBuilder) diff --git a/script/vm/init.lua b/script/vm/init.lua index 5a5de99e..a34b5d71 100644 --- a/script/vm/init.lua +++ b/script/vm/init.lua @@ -1,5 +1,5 @@ local vm = require 'vm.vm' -require 'vm.state' +require 'vm.manager' require 'vm.getGlobals' require 'vm.getDocs' require 'vm.getLibrary' diff --git a/script/vm/literal-node.lua b/script/vm/literal-manager.lua index 9c1f70a8..9c1f70a8 100644 --- a/script/vm/literal-node.lua +++ b/script/vm/literal-manager.lua diff --git a/script/vm/state.lua b/script/vm/manager.lua index 901cf081..b80cfb43 100644 --- a/script/vm/state.lua +++ b/script/vm/manager.lua @@ -1,14 +1,14 @@ -local files = require 'files' -local globalNode = require 'vm.global-node' -local literalNode = require 'vm.literal-node' +local files = require 'files' +local globalManager = require 'vm.global-manager' +local literalManager = require 'vm.literal-manager' ---@class vm.state local m = {} for uri in files.eachFile() do local state = files.getState(uri) if state then - globalNode.compileAst(state.ast) + globalManager.compileAst(state.ast) end end @@ -16,12 +16,12 @@ files.watch(function (ev, uri) if ev == 'update' then local state = files.getState(uri) if state then - globalNode.compileAst(state.ast) + globalManager.compileAst(state.ast) end end if ev == 'remove' then - globalNode.dropUri(uri) - literalNode.dropUri(uri) + globalManager.dropUri(uri) + literalManager.dropUri(uri) end end) diff --git a/script/vm/node/compiler.lua b/script/vm/node/compiler.lua index e8595ebf..e642856a 100644 --- a/script/vm/node/compiler.lua +++ b/script/vm/node/compiler.lua @@ -1,8 +1,8 @@ -local guide = require 'parser.guide' -local util = require 'utility' -local union = require 'vm.node.union' -local localID = require 'vm.local-id' -local literalNode = require 'vm.literal-node' +local guide = require 'parser.guide' +local util = require 'utility' +local union = require 'vm.node.union' +local localID = require 'vm.local-id' +local literalMgr = require 'vm.literal-manager' ---@class parser.object ---@field _compiledNodes boolean @@ -119,7 +119,7 @@ local compilerMap = util.switch() : case 'string' : case 'function' : call(function (source) - m.setNode(source, literalNode.declareLiteral(source)) + m.setNode(source, literalMgr.declareLiteral(source)) end) : case 'local' : call(function (source) @@ -183,7 +183,7 @@ function m.compileNode(source) if compiler then compiler(source) end - literalNode.subscribeLiteral(source, source._node) + literalMgr.subscribeLiteral(source, source._node) if source._globalNode then m.setNode(source, source._globalNode) end diff --git a/script/vm/node/union.lua b/script/vm/node/union.lua index a8c917d9..a550e1a5 100644 --- a/script/vm/node/union.lua +++ b/script/vm/node/union.lua @@ -1,4 +1,4 @@ -local state = require 'vm.state' +local literalMgr = require 'vm.literal-manager' ---@class vm.node.union local mt = {} @@ -22,7 +22,7 @@ end ---@param source parser.object function mt:subscribeLiteral(source) for _, c in ipairs(self) do - state.subscribeLiteral(source, c) + literalMgr.subscribeLiteral(source, c) if c.type == 'cross' then c:subscribeLiteral(source) end |