diff options
Diffstat (limited to 'script/parser/guide.lua')
-rw-r--r-- | script/parser/guide.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/script/parser/guide.lua b/script/parser/guide.lua index 8d2708cf..ad07e90e 100644 --- a/script/parser/guide.lua +++ b/script/parser/guide.lua @@ -972,9 +972,13 @@ end ---@param source parser.guide.object ---@return boolean function m.isGlobal(source) + if source._isGlobal ~= nil then + return source._isGlobal + end if source.type == 'setglobal' or source.type == 'getglobal' then if source.node and source.node.tag == '_ENV' then + source._isGlobal = true return true end end @@ -982,8 +986,10 @@ function m.isGlobal(source) source = source.parent end if source.special == '_G' then + source._isGlobal = true return true end + source._isGlobal = false return false end |