summaryrefslogtreecommitdiff
path: root/script/parser
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-01-09 17:42:27 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-01-09 17:42:27 +0800
commit1ca3b7d67c0c30af1f67fae71b5c770b9008e4d5 (patch)
tree3fc65cdcca53aec16a1e03843a473ea5e9045cc3 /script/parser
parentc796d406329170e010590d7c9584b8483021cee3 (diff)
downloadlua-language-server-1ca3b7d67c0c30af1f67fae71b5c770b9008e4d5.zip
improve performance
Diffstat (limited to 'script/parser')
-rw-r--r--script/parser/guide.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/script/parser/guide.lua b/script/parser/guide.lua
index b9bfe30b..0cf41389 100644
--- a/script/parser/guide.lua
+++ b/script/parser/guide.lua
@@ -1253,9 +1253,13 @@ function m.getTopBlock(source)
if not m.isBlockType(block) then
return nil
end
- if block.type ~= 'do' then
+ if block.type ~= 'do'
+ and block.type ~= 'in'
+ and block.type ~= 'loop'
+ and block.type ~= 'repeat' then
return block
end
+ source = block
end
return nil
end