Skip to content

Commit 9202def

Browse files
committed
update checking for keyword global
1 parent bbad28b commit 9202def

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

script/parser/compile.lua

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1607,7 +1607,15 @@ local function isKeyWord(word, nextToken)
16071607
end
16081608
if word == 'global' then
16091609
if State.version == 'Lua 5.5' then
1610-
return true
1610+
if not nextToken then
1611+
return true
1612+
end
1613+
if nextToken == '*'
1614+
or nextToken == '<'
1615+
or CharMapWord[ssub(nextToken, 1, 1)] then
1616+
return true
1617+
end
1618+
return false
16111619
end
16121620
return false
16131621
end

test/hover/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ TEST[[
253253
TEST [[
254254
local <?v?> = collectgarbage()
255255
]]
256-
"local v: any"
256+
"local v: nil"
257257

258258
TEST [[
259259
local type

0 commit comments

Comments
 (0)