diff options
Diffstat (limited to 'script/vm/node/compiler.lua')
-rw-r--r-- | script/vm/node/compiler.lua | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/script/vm/node/compiler.lua b/script/vm/node/compiler.lua index dfe4bc0c..e8595ebf 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 state = require 'vm.state' -local union = require 'vm.node.union' -local localID = require 'vm.local-id' +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' ---@class parser.object ---@field _compiledNodes boolean @@ -119,7 +119,7 @@ local compilerMap = util.switch() : case 'string' : case 'function' : call(function (source) - m.setNode(source, state.declareLiteral(source)) + m.setNode(source, literalNode.declareLiteral(source)) end) : case 'local' : call(function (source) @@ -183,7 +183,10 @@ function m.compileNode(source) if compiler then compiler(source) end - state.subscribeLiteral(source, source._node) + literalNode.subscribeLiteral(source, source._node) + if source._globalNode then + m.setNode(source, source._globalNode) + end return source._node end |