func (scopes *scopes) Current(name string) (*ast.Identifier, bool) {
	n, ok := scopes.s[len(scopes.s)-1].names[name]
	return n.decl, ok
}
Current returns the identifier of name as declared in the current scope and
true. Otherwise it returns nil and false.
package compiler
import (
	"reflect"
	"github.com/open2b/scriggo/ast"
)
type scopes struct {
	s           []scope
	path        string
	allowUnused bool
}
type scope struct {
	fn scopeFunc
	block *ast.Position
	names map[string]scopeName
}
type scopeFunc struct {
	node *ast.Func
	labels map[string]scopeLabel
}
type scopeName struct {
	ti *typeInfo
	decl *ast.Identifier
	impor *ast.Import
	used bool
}
type scopeLabel struct {
	block *ast.Position
	node *ast.Label
	used bool
	gotos []scopeGoto
}
type scopeGoto struct {
	pos *ast.Position
	blocks []*ast.Position
}
func newScopes(path string, formats map[ast.Format]reflect.Type, global map[string]scopeName) *scopes {
	var formatScope scope
	if len(formats) > 0 {
		formatScope = scope{names: map[string]scopeName{}}
		for f, t := range formats {
			name := formatTypeName[f]
			formatScope.names[name] = scopeName{ti: &typeInfo{
				Type:       t,
				Properties: propertyIsType | propertyIsFormatType | propertyUniverse,
			}}
		}
	}
	return &scopes{
		path: path,
		s:    []scope{{names: universe}, formatScope, {names: global}, {names: map[string]scopeName{}}},
	}
}
func (scopes *scopes) AllowUnused() {
	scopes.allowUnused = true
}
func (scopes *scopes) Universe(name string) (*typeInfo, bool) {
	n, ok := universe[name]
	if ok {
		return n.ti, true
	}
	n, ok = scopes.s[1].names[name]
	return n.ti, ok
}
func (scopes *scopes) Global(name string) (*typeInfo, bool) {
	n, ok := scopes.s[2].names[name]
	return n.ti, ok
}
func (scopes *scopes) FilePackage(name string) (*typeInfo, bool) {
	n, ok := scopes.s[3].names[name]
	return n.ti, ok
}