summaryrefslogtreecommitdiff
path: root/script/vm
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-24 22:39:58 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-24 22:39:58 +0800
commit943ba62782d8eed159c1b548c2718db228afc1a8 (patch)
tree12bde74001531c3258d01d1c8c26cc5480b5cfd8 /script/vm
parent1d7773f05477ca3f637fa8afe05658868bf38a26 (diff)
downloadlua-language-server-943ba62782d8eed159c1b548c2718db228afc1a8.zip
fix `or`
Diffstat (limited to 'script/vm')
-rw-r--r--script/vm/runner.lua12
1 files changed, 3 insertions, 9 deletions
diff --git a/script/vm/runner.lua b/script/vm/runner.lua
index dedc48be..ad2b18ea 100644
--- a/script/vm/runner.lua
+++ b/script/vm/runner.lua
@@ -82,20 +82,14 @@ function mt:_compileNarrowByFilter(filter, outStep, blockStep)
self:_compileNarrowByFilter(filter[2], dummyStep, blockStep)
end
if filter.op.type == 'or' then
+ self:_compileNarrowByFilter(filter[1], outStep, blockStep)
local dummyStep = {
- type = 'save',
- tag = 'dummy out',
+ type = 'push',
copy = true,
ref1 = outStep,
- pos = filter.start - 1,
- }
- self.steps[#self.steps+1] = dummyStep
- self:_compileNarrowByFilter(filter[1], dummyStep, blockStep)
- self.steps[#self.steps+1] = {
- type = 'push',
- ref1 = dummyStep,
pos = filter.op.finish,
}
+ self.steps[#self.steps+1] = dummyStep
self:_compileNarrowByFilter(filter[2], outStep, dummyStep)
self.steps[#self.steps+1] = {
type = 'push',