scope

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2019 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scope

type Scope struct {
	Owner ast.Node
	Outer *Scope
	// contains filtered or unexported fields
}

Scope type

func New

func New(owner ast.Node) *Scope

New Scope based on an old scope

func (*Scope) Insert

func (s *Scope) Insert(obj *ast.Object) (alt *ast.Object)

Insert attempts to insert a named object obj into the scope s. If the scope already contains an object alt with the same name, Insert leaves the scope unchanged and returns alt. Otherwise it inserts obj and returns nil.

func (*Scope) Lookup

func (s *Scope) Lookup(name string) *ast.Object

Lookup name in scope and all parent scopes

func (*Scope) String

func (s *Scope) String() string

Debugging support

func (*Scope) Within

func (s *Scope) Within(name string) *ast.Object

Within looks up a name within a scope (doesn't traverse upward)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL