packageLevelValue returns the package-level value corresponding to the specified named object, which may be a package-level const (*Const), var (*Global) or func (*Function) of some package in prog. It returns nil if the object is not found.
(obj Object)
| 28 | // prog. It returns nil if the object is not found. |
| 29 | // |
| 30 | func (prog *Program) packageLevelValue(obj Object) Value { |
| 31 | if pkg := prog.Package(obj.Pkg()); pkg != nil { |
| 32 | return pkg.values[obj] |
| 33 | } |
| 34 | return nil |
| 35 | } |
| 36 | |
| 37 | // tokenPos returns n.Pos(). |
| 38 | // |