func (r *Resolver) declare(name token.Token) {
	if len(r.scopes) == 0 {
		return
	}
	scope := r.scopes[len(r.scopes)-1]
	if _, ok := scope[name.StringValue]; ok {
		r.reportNameError(name, "variable redefined in this scope")
	}
	scope[name.StringValue] = &scopeVarInfo{resolved: false}
}
// declare adds the variable to the innermost scope such that it shadows the
// outer one, so that we know it exists
declare adds the variable to the innermost scope such that it shadows the
outer one, so that we know it exists
// declare adds the variable to the innermost scope such that it shadows the // outer one so that we know it exists
func (r *Resolver) declare(name token.Token) {
	if len(r.scopes) == 0 {
		return
	}
	scope := r.scopes[len(r.scopes)-1]
	if _, ok := scope[name.StringValue]; ok {
		r.reportNameError(name, "variable redefined in this scope")
	}
	scope[name.StringValue] = &scopeVarInfo{resolved: false}
}
func ( r * Resolver ) declare ( name token . Token ) { if len ( r . scopes ) == 0 { return } scope := r . scopes [ len ( r . scopes ) - 1 ] if _ , ok := scope [ name . StringValue ] ; ok { r . reportNameError ( name , " " ) } scope [ name . StringValue ] = & scopeVarInfo { resolved : false } }
declare adds the variable to the innermost scope such that it shadows the
outer one, so that we know it exists
declare adds the variable to the innermost scope such that it shadows the outer one so that we know it exists