The resolver sets the Locals and FreeVars arrays of each DefStmt and
the LocalIndex field of each syntax.Ident that refers to a local or
free variable. It also sets the Locals array of a File for locals
bound by comprehensions outside any function. Identifiers for global
variables do not get an index.

const (
UndefinedScope = iota// name is not definedLocal// name is local to its functionFree// name is local to some enclosing functionGlobal// name is global to moduleBuiltin// name is universal (e.g. len)
)