Skip to content

Commit 5e112de

Browse files
committed
some fix
#1895
1 parent d4583fe commit 5e112de

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

script/parser/compile.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,7 +1389,7 @@ local function isKeyWord(word, nextToken)
13891389
end
13901390
if State.version == 'LuaJIT' then
13911391
if not nextToken then
1392-
return true
1392+
return false
13931393
end
13941394
if CharMapWord[ssub(nextToken, 1, 1)] then
13951395
return true
@@ -1422,7 +1422,7 @@ local function parseName(asAction)
14221422
finish = finishPos,
14231423
}
14241424
end
1425-
if isKeyWord(word, Tokens[Index]) then
1425+
if isKeyWord(word, Tokens[Index + 1]) then
14261426
pushError {
14271427
type = 'KEYWORD',
14281428
start = startPos,
@@ -2235,7 +2235,7 @@ local function parseParams(params)
22352235
finish = getPosition(Tokens[Index] + #token - 1, 'right'),
22362236
}
22372237
end
2238-
if isKeyWord(token, Tokens[Index + 2]) then
2238+
if isKeyWord(token, Tokens[Index + 3]) then
22392239
pushError {
22402240
type = 'KEYWORD',
22412241
start = getPosition(Tokens[Index], 'left'),
@@ -3797,7 +3797,7 @@ function parseAction()
37973797
return parseRepeat()
37983798
end
37993799

3800-
if token == 'goto' and isKeyWord 'goto' then
3800+
if token == 'goto' and isKeyWord('goto', Tokens[Index + 3]) then
38013801
return parseGoTo()
38023802
end
38033803

0 commit comments

Comments
 (0)