File tree Expand file tree Collapse file tree 5 files changed +23
-1
lines changed Expand file tree Collapse file tree 5 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 9898--- @async
9999--- @param level integer
100100local function asGlobal (source , level )
101+ if source .declare and source [1 ] == ' *' then
102+ return ' (global) any' , 0
103+ end
101104 return asValue (source , ' (global)' , level )
102105end
103106
Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ local Care = util.switch()
1818 end
1919
2020 local name = source [1 ]
21+ if source .declare and name == ' *' then
22+ return
23+ end
2124 local isLib = options .libGlobals [name ]
2225 if isLib == nil then
2326 isLib = false
@@ -38,6 +41,10 @@ local Care = util.switch()
3841 local type = isFunc and define .TokenTypes [' function' ] or define .TokenTypes .variable
3942 local modifier = isLib and define .TokenModifiers .defaultLibrary or define .TokenModifiers .global
4043
44+ if source .declare then
45+ modifier = modifier | define .TokenModifiers .declaration
46+ end
47+
4148 results [# results + 1 ] = {
4249 start = source .start ,
4350 finish = source .finish ,
Original file line number Diff line number Diff line change @@ -3415,7 +3415,7 @@ local function parseGlobal()
34153415 if Tokens [Index + 1 ] == ' *' then
34163416 local action = {
34173417 type = ' globalall' ,
3418- start = globalPos ,
3418+ start = getPosition ( Tokens [ Index ], ' left ' ) ,
34193419 finish = getPosition (Tokens [Index ], ' right' ),
34203420 attrs = attrs ,
34213421 [1 ] = ' *' ,
Original file line number Diff line number Diff line change @@ -2512,3 +2512,12 @@ end
25122512[[
25132513function f(a: number, b: string, ...args: boolean)
25142514]]
2515+
2516+ config .set (nil , ' Lua.runtime.version' , ' Lua 5.5' )
2517+ TEST [[
2518+ global <?*?>
2519+ ]]
2520+ [[
2521+ (global) any
2522+ ]]
2523+ config .set (nil , ' Lua.runtime.version' , nil )
Original file line number Diff line number Diff line change @@ -1022,4 +1022,7 @@ global <!X!>
10221022]]
10231023{
10241024 type = ' ENV_IS_GLOBAL' ,
1025+ info = {
1026+ name = ' X' ,
1027+ }
10251028}
You can’t perform that action at this time.
0 commit comments