diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-04-24 03:39:07 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-04-24 03:39:07 +0800 |
commit | ad626d2cfdc9b64c4d2d86dc5e0d352c37788eef (patch) | |
tree | 0e810d5fca509a3fd0fb452ce666f424e939f8b3 /script/vm/runner.lua | |
parent | 021a3ff60c46ffbc8fc488136f7857da5c21b71b (diff) | |
download | lua-language-server-ad626d2cfdc9b64c4d2d86dc5e0d352c37788eef.zip |
cleanup
Diffstat (limited to 'script/vm/runner.lua')
-rw-r--r-- | script/vm/runner.lua | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/script/vm/runner.lua b/script/vm/runner.lua index 2771b0a9..2ad1bc4a 100644 --- a/script/vm/runner.lua +++ b/script/vm/runner.lua @@ -156,7 +156,6 @@ function mt:_compileBlock(block) tag = 'out', copy = true, pos = block.start, - order = 1, } self.steps[#self.steps+1] = outStep local blockStep = { @@ -165,7 +164,6 @@ function mt:_compileBlock(block) copy = true, ref = outStep, pos = childBlock.start, - order = 2, } self.steps[#self.steps+1] = blockStep self:_compileNarrowByFilter(childBlock.filter, outStep, blockStep) @@ -177,7 +175,6 @@ function mt:_compileBlock(block) tag = 'final', ref1 = outStep, pos = childBlock.finish, - order = 1, } end for i, final in ipairs(finals) do @@ -185,7 +182,6 @@ function mt:_compileBlock(block) type = 'merge', ref2 = final, pos = block.finish, - order = i, } end end @@ -194,13 +190,11 @@ function mt:_compileBlock(block) self.steps[#self.steps+1] = { type = 'load', pos = block.start, - order = 1, } local savePoint = { type = 'save', copy = true, pos = block.start, - order = 2, } self.steps[#self.steps+1] = savePoint self.steps[#self.steps+1] = { @@ -221,6 +215,11 @@ function mt:_preCompile() local block = guide.getParentBlock(ref) self:_compileBlock(block) end + for i, step in ipairs(self.steps) do + if step.type ~= 'object' then + step.order = i + end + end table.sort(self.steps, function (a, b) if a.pos == b.pos then return (a.order or 0) < (b.order or 0) |