summaryrefslogtreecommitdiff
path: root/server-beta/src/searcher/isGlobal.lua
blob: 549220a9d7df4bb4f662e3588a2376e6d0f39bda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
local searcher = require 'searcher.searcher'

function searcher.isGlobal(source)
    local node = source.node
    if not node then
        return false
    end
    local isGlobal
    searcher.eachRef(node, function (info)
        if info.source.tag == '_ENV' then
            isGlobal = true
        end
    end)
    return isGlobal
end