@@ -1379,12 +1379,24 @@ local function parseNumber()
13791379 return result
13801380end
13811381
1382- local function isKeyWord (word )
1382+ local function isKeyWord (word , nextToken )
13831383 if KeyWord [word ] then
13841384 return true
13851385 end
13861386 if word == ' goto' then
1387- return State .version ~= ' Lua 5.1'
1387+ if State .version == ' Lua 5.1' then
1388+ return false
1389+ end
1390+ if State .version == ' LuaJIT' then
1391+ if not nextToken then
1392+ return true
1393+ end
1394+ if CharMapWord [ssub (nextToken , 1 , 1 )] then
1395+ return true
1396+ end
1397+ return false
1398+ end
1399+ return true
13881400 end
13891401 return false
13901402end
@@ -1410,7 +1422,7 @@ local function parseName(asAction)
14101422 finish = finishPos ,
14111423 }
14121424 end
1413- if isKeyWord (word ) then
1425+ if isKeyWord (word , Tokens [ Index ] ) then
14141426 pushError {
14151427 type = ' KEYWORD' ,
14161428 start = startPos ,
@@ -1491,7 +1503,7 @@ local function parseExpList(mini)
14911503 break
14921504 end
14931505 local nextToken = peekWord ()
1494- if isKeyWord (nextToken )
1506+ if isKeyWord (nextToken , Tokens [ Index + 2 ] )
14951507 and nextToken ~= ' function'
14961508 and nextToken ~= ' true'
14971509 and nextToken ~= ' false'
@@ -2223,7 +2235,7 @@ local function parseParams(params)
22232235 finish = getPosition (Tokens [Index ] + # token - 1 , ' right' ),
22242236 }
22252237 end
2226- if isKeyWord (token ) then
2238+ if isKeyWord (token , Tokens [ Index + 2 ] ) then
22272239 pushError {
22282240 type = ' KEYWORD' ,
22292241 start = getPosition (Tokens [Index ], ' left' ),
0 commit comments