summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-03-08 15:41:31 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-03-08 15:41:31 +0800
commita16676ea0ec939c6848f88247e336223d20a2378 (patch)
tree174dcabff8bf68978a6ee5ca2c6b493db8413683 /server/src
parent0af858e47af3cfc71bc3294f849108b5c00d0b11 (diff)
downloadlua-language-server-a16676ea0ec939c6848f88247e336223d20a2378.zip
修正一些问题
Diffstat (limited to 'server/src')
-rw-r--r--server/src/service.lua5
-rw-r--r--server/src/vm/vm.lua4
2 files changed, 4 insertions, 5 deletions
diff --git a/server/src/service.lua b/server/src/service.lua
index 6fa6c897..aa85fc49 100644
--- a/server/src/service.lua
+++ b/server/src/service.lua
@@ -6,7 +6,8 @@ local rpc = require 'rpc'
local parser = require 'parser'
local core = require 'core'
local lang = require 'language'
-local updateTimer = require 'timer'
+local updateTimer= require 'timer'
+local buildVM = require 'vm'
local ErrorCodes = {
-- Defined by JSON RPC
@@ -322,7 +323,7 @@ function mt:compileVM(uri)
self:_clearGlobal(uri, compiled)
local clock = os.clock()
- local vm = core.vm(ast, self, uri)
+ local vm = buildVM(ast, self, uri)
if version ~= obj.version then
return nil
end
diff --git a/server/src/vm/vm.lua b/server/src/vm/vm.lua
index 9e89c6e6..57b6c1cd 100644
--- a/server/src/vm/vm.lua
+++ b/server/src/vm/vm.lua
@@ -372,9 +372,9 @@ function mt:setName(name, source, value)
if global then
return global
end
- source:bindValue(global, 'set')
local ENV = self:loadLocal('_ENV')
local ENVValue = ENV:getValue()
+ source:bindValue(value, 'set')
ENVValue:setChild(name, value)
source:set('global', true)
source:set('parentValue', ENVValue)
@@ -743,7 +743,6 @@ function mt:setOne(var, value)
self:instantSource(var)
if var.type == 'name' then
self:setName(var[1], var, value)
- var:bindValue(value, 'set')
elseif var.type == 'simple' then
local parent = self:getSimple(var, -2)
local key = var[#var]
@@ -916,7 +915,6 @@ function mt:doFunction(action)
else
local value = self:buildFunction(action)
self:setName(name[1], name, value)
- name:bindValue(value, 'set')
end
else
self:buildFunction(action)