func (d VarDomain) String() string {
	switch d {
	case DomainDefault:
		return "(default)"
	case DomainEnv:
		return "ENV"
	case DomainCache:
		return "CACHE"
	case DomainMake:
		return "(make)"
	default:
		panic("invalid domain")
	}
}
String implements fmt.Stringer for VarDomain and returns a user-readable string for the domain.
package ast
import "fmt"
const (
	DomainDefault VarDomain = iota  
	DomainCache                     
	DomainEnv                       
	DomainMake                      
)
type VarDomain int
func (d *VarDomain) Capture(values []string) error {
	if len(values) > 1 {
		return fmt.Errorf("invalid Domain values: %v", values)
	}
	value := values[0]
	if len(value) > 0 && value[0] == '$' {
		value = value[1 : len(value)-1]
	}
	switch value {
	case "":
		*d = DomainDefault
	case "CACHE":
		*d = DomainCache
	case "ENV":
		*d = DomainEnv
	default:
		return fmt.Errorf("invalid Domain: %s", value)
	}
	return nil
}