summaryrefslogtreecommitdiff
path: root/script/parser/newparser.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-24 05:37:32 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-24 05:37:32 +0800
commit7d51c01c0b9f4ab70d1ee95950d481cbc40f9092 (patch)
tree2406a678ccf509554850a0ccd52d7b66df064c35 /script/parser/newparser.lua
parent33cc241c685b66173423eee57b32876c5dd4aa3e (diff)
downloadlua-language-server-7d51c01c0b9f4ab70d1ee95950d481cbc40f9092.zip
infer by `break`
Diffstat (limited to 'script/parser/newparser.lua')
-rw-r--r--script/parser/newparser.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/script/parser/newparser.lua b/script/parser/newparser.lua
index 35854c9b..4c58ead6 100644
--- a/script/parser/newparser.lua
+++ b/script/parser/newparser.lua
@@ -3606,6 +3606,15 @@ local function parseBreak()
break
end
end
+ for i = #Chunk, 1, -1 do
+ local chunk = Chunk[i]
+ if chunk.type == 'ifblock'
+ or chunk.type == 'elseifblock'
+ or chunk.type == 'elseblock' then
+ chunk.hasBreak = true
+ break
+ end
+ end
if not ok and Mode == 'Lua' then
pushError {
type = 'BREAK_OUTSIDE',