summaryrefslogtreecommitdiff
path: root/script/vm/node/compiler.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-02-23 18:06:16 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-02-23 18:06:16 +0800
commit608aebdc13ebd64ae81d81049e7bbb3cc13cb891 (patch)
tree65796a59f02d05a25cae2fdae218b63f2b11f4bf /script/vm/node/compiler.lua
parent3de3402c82c4ea46f69d0a96bea7faf1ad68ea06 (diff)
downloadlua-language-server-608aebdc13ebd64ae81d81049e7bbb3cc13cb891.zip
update
Diffstat (limited to 'script/vm/node/compiler.lua')
-rw-r--r--script/vm/node/compiler.lua17
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