summaryrefslogtreecommitdiff
path: root/script/parser
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-02-10 15:53:32 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-02-10 15:53:32 +0800
commit5e112de9cbf4627038036fdfa41e9cf890d74e1d (patch)
treec70fc2b24e9aae22aaee635bc3fe136ff0729350 /script/parser
parentd4583feec1c19476428fce5cc8a8cf570db88ffd (diff)
downloadlua-language-server-5e112de9cbf4627038036fdfa41e9cf890d74e1d.zip
some fix
#1895
Diffstat (limited to 'script/parser')
-rw-r--r--script/parser/compile.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/script/parser/compile.lua b/script/parser/compile.lua
index 9af8abf1..7cc6f36b 100644
--- a/script/parser/compile.lua
+++ b/script/parser/compile.lua
@@ -1389,7 +1389,7 @@ local function isKeyWord(word, nextToken)
end
if State.version == 'LuaJIT' then
if not nextToken then
- return true
+ return false
end
if CharMapWord[ssub(nextToken, 1, 1)] then
return true
@@ -1422,7 +1422,7 @@ local function parseName(asAction)
finish = finishPos,
}
end
- if isKeyWord(word, Tokens[Index]) then
+ if isKeyWord(word, Tokens[Index + 1]) then
pushError {
type = 'KEYWORD',
start = startPos,
@@ -2235,7 +2235,7 @@ local function parseParams(params)
finish = getPosition(Tokens[Index] + #token - 1, 'right'),
}
end
- if isKeyWord(token, Tokens[Index + 2]) then
+ if isKeyWord(token, Tokens[Index + 3]) then
pushError {
type = 'KEYWORD',
start = getPosition(Tokens[Index], 'left'),
@@ -3797,7 +3797,7 @@ function parseAction()
return parseRepeat()
end
- if token == 'goto' and isKeyWord 'goto' then
+ if token == 'goto' and isKeyWord('goto', Tokens[Index + 3]) then
return parseGoTo()
end