Skip to content

Commit

Permalink
some fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Feb 10, 2023
1 parent d4583fe commit 5e112de
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions script/parser/compile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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'),
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 5e112de

Please sign in to comment.