diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-12-11 20:57:52 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-12-11 20:57:52 +0800 |
commit | a1b5be3d5561cf4f8e185d02e69b2d21fc840b98 (patch) | |
tree | ea5d5c977316c3d3adbec799d043b5a6750feb49 /server/src/matcher/vm.lua | |
parent | 4534a804e161a03cd1a47f79bb924bf9b7df1f60 (diff) | |
download | lua-language-server-a1b5be3d5561cf4f8e185d02e69b2d21fc840b98.zip |
修正一些bug
Diffstat (limited to 'server/src/matcher/vm.lua')
-rw-r--r-- | server/src/matcher/vm.lua | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/server/src/matcher/vm.lua b/server/src/matcher/vm.lua index 19a844df..f5e84bc5 100644 --- a/server/src/matcher/vm.lua +++ b/server/src/matcher/vm.lua @@ -633,19 +633,17 @@ end function mt:doIf(action) for _, block in ipairs(action) do - self.scope:push() if block.filter then self:getExp(block.filter) end + self.scope:push() self:doActions(block) - self.scope:pop() end end function mt:doLoop(action) - self.scope:push() local min = self:getExp(action.min) self:getExp(action.max) @@ -653,16 +651,13 @@ function mt:doLoop(action) self:getExp(action.step) end - local arg = self:createLocal(action.arg[1], action.arg, min) - + self.scope:push() + self:createLocal(action.arg[1], action.arg, min) self:doActions(action) - self.scope:pop() end function mt:doIn(action) - self.scope:push() - local func local list = { type = 'list' @@ -675,6 +670,8 @@ function mt:doIn(action) else func = self:getExp(action.exp) end + + self.scope:push() local args = self:unpackList(list) local values = self:call(func, args) self:forList(action.arg, function (arg) @@ -688,21 +685,18 @@ function mt:doIn(action) end function mt:doWhile(action) - self.scope:push() self:getExp(action.filter) + self.scope:push() self:doActions(action) - self.scope:pop() end function mt:doRepeat(action) self.scope:push() - self:doActions(action) self:getExp(action.filter) - self.scope:pop() end |