summaryrefslogtreecommitdiff
path: root/script/parser
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-09-29 17:06:16 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-09-29 17:06:16 +0800
commitf4a4fc63cf14f038a07068292909432f28f0c2a7 (patch)
treedddbaf6c9bf5367202f2807a8e599f3254ceb67a /script/parser
parentec613851607c1fdeb256afa195d79760bb2e66c6 (diff)
downloadlua-language-server-f4a4fc63cf14f038a07068292909432f28f0c2a7.zip
fix
Diffstat (limited to 'script/parser')
-rw-r--r--script/parser/newparser.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/script/parser/newparser.lua b/script/parser/newparser.lua
index d63d8f62..8b5fe034 100644
--- a/script/parser/newparser.lua
+++ b/script/parser/newparser.lua
@@ -1958,7 +1958,8 @@ local function isChunkFinishToken(token)
end
if tp == 'for'
or tp == 'in'
- or tp == 'loop' then
+ or tp == 'loop'
+ or tp == 'function' then
return token == 'end'
end
if tp == 'if'
@@ -1970,6 +1971,9 @@ local function isChunkFinishToken(token)
or token == 'else'
or token == 'elseif'
end
+ if tp == 'repeat' then
+ return token == 'until'
+ end
return true
end
@@ -1988,7 +1992,9 @@ local function parseActions()
end
local action, failed = parseAction()
if failed then
- break
+ if not skipUnknownSymbol() then
+ break
+ end
end
if action then
if action.type == 'return' then