// NewGlob constructs a Glob from the given string by tokenizing and then simplifying it, or reports errors if any.
428308
func NewGlob(input string) (Glob, error) {
	tokens, err := Tokenize([]rune(input))
	if err != nil {
		return nil, err
	}

	tokens = Simplify(tokens)

	return Glob(tokens), nil
}
626698
func New() locales.Translator {
	return &gl{
		locale:                 "gl",
		pluralsCardinal:        []locales.PluralRule{2, 6},
		pluralsOrdinal:         []locales.PluralRule{6},
		pluralsRange:           []locales.PluralRule{2, 6},
		decimal:                ",",
		group:                  ".",
		minus:                  "-",
		percent:                "%",
		perMille:               "‰",
		timeSeparator:          ":",
		inifinity:              "∞",
		currencies:             []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "A$", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "R$", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CA$", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CN¥", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "₧", "ETB", "€", "FIM", "FJD", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HK$", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "₪", "₹", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JP¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "₩", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "$MX", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZ$", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "฿", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "$", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "₫", "VNN", "VUV", "WST", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "EC$", "XDR", "XEU", "XFO", "XFU", "CFA", "XPD", "CFPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
		percentSuffix:          " ",
		currencyPositiveSuffix: " ",
		currencyNegativeSuffix: " ",
		monthsAbbreviated:      []string{"", "xan.", "feb.", "mar.", "abr.", "maio", "xuño", "xul.", "ago.", "set.", "out.", "nov.", "dec."},
		monthsNarrow:           []string{"", "x.", "f.", "m.", "a.", "m.", "x.", "x.", "a.", "s.", "o.", "n.", "d."},
		monthsWide:             []string{"", "xaneiro", "febreiro", "marzo", "abril", "maio", "xuño", "xullo", "agosto", "setembro", "outubro", "novembro", "decembro"},
		daysAbbreviated:        []string{"dom.", "luns", "mar.", "mér.", "xov.", "ven.", "sáb."},
		daysNarrow:             []string{"d.", "l.", "m.", "m.", "x.", "v.", "s."},
		daysShort:              []string{"do.", "lu.", "ma.", "mé.", "xo.", "ve.", "sá."},
		daysWide:               []string{"domingo", "luns", "martes", "mércores", "xoves", "venres", "sábado"},
		periodsAbbreviated:     []string{"a.m.", "p.m."},
		periodsNarrow:          []string{"a.m.", "p.m."},
		periodsWide:            []string{"a.m.", "p.m."},
		erasAbbreviated:        []string{"a.C.", "d.C."},
		erasNarrow:             []string{"", ""},
		erasWide:               []string{"antes de Cristo", "despois de Cristo"},
		timezones:              map[string]string{"TMST": "Horario de verán de Turcomenistán", "MYT": "Horario de Malaisia", "CAT": "Horario de África Central", "EST": "Horario estándar do leste, Norteamérica", "COST": "Horario de verán de Colombia", "ChST": "Horario estándar chamorro", "HKST": "Horario de verán de Hong Kong", "CLT": "Horario estándar de Chile", "OESZ": "Horario de verán de Europa Oriental", "HADT": "Horario de verán de Hawai-Aleutiano", "HNPMX": "Horario estándar do Pacífico mexicano", "SAST": "Horario estándar de África do Sur", "WAT": "Horario estándar de África Occidental", "WEZ": "Horario estándar de Europa Occidental", "SRT": "Horario de Suriname", "ART": "Horario estándar da Arxentina", "HEPMX": "Horario de verán do Pacífico mexicano", "AEST": "Horario estándar de Australia Oriental", "BOT": "Horario de Bolivia", "JDT": "Horario de verán do Xapón", "AKST": "Horario estándar de Alasca", "HEOG": "Horario de verán de Groenlandia Occidental", "HKT": "Horario estándar de Hong Kong", "WARST": "Horario de verán da Arxentina Occidental", "HENOMX": "Horario de verán do noroeste de México", "HNOG": "Horario estándar de Groenlandia Occidental", "MEZ": "Horario estándar de Europa Central", "LHDT": "Horario de verán de Lord Howe", "COT": "Horario estándar de Colombia", "AST": "Horario estándar do Atlántico", "WESZ": "Horario de verán de Europa Occidental", "VET": "Horario de Venezuela", "HEPM": "Horario de verán de Saint-Pierre-et-Miquelon", "WITA": "Horario de Indonesia Central", "HNNOMX": "Horario estándar do noroeste de México", "MST": "MST", "EAT": "Horario de África Oriental", "CHADT": "Horario de verán de Chatham", "HNCU": "Horario estándar de Cuba", "ADT": "Horario de verán do Atlántico", "WAST": "Horario de verán de África Occidental", "BT": "Horario de Bután", "GFT": "Horario da Güiana Francesa", "ACWST": "Horario estándar de Australia Occidental Central", "IST": "Horario estándar da India", "WIT": "Horario de Indonesia Oriental", "UYT": "Horario estándar do Uruguai", "PST": "Horario estándar do Pacífico, Norteamérica", "ACST": "Horario estándar de Australia Central", "HEEG": "Horario de verán de Groenlandia Oriental", "LHST": "Horario estándar de Lord Howe", "HAST": "Horario estándar de Hawai-Aleutiano", "CDT": "Horario de verán central, Norteamérica", "AWST": "Horario estándar de Australia Occidental", "NZDT": "Horario de verán de Nova Zelandia", "AKDT": "Horario de verán de Alasca", "SGT": "Horario estándar de Singapur", "HNT": "Horario estándar de Terranova", "MDT": "MDT", "CLST": "Horario de verán de Chile", "GMT": "Horario do meridiano de Greenwich", "GYT": "Horario da Güiana", "CST": "Horario estándar central, Norteamérica", "JST": "Horario estándar do Xapón", "ACDT": "Horario de verán de Australia Central", "ACWDT": "Horario de verán de Australia Occidental Central", "HNPM": "Horario estándar de Saint-Pierre-et-Miquelon", "UYST": "Horario de verán do Uruguai", "ECT": "Horario de Ecuador", "OEZ": "Horario estándar de Europa Oriental", "∅∅∅": "Horario de verán do Amazonas", "CHAST": "Horario estándar de Chatham", "NZST": "Horario estándar de Nova Zelandia", "PDT": "Horario de verán do Pacífico, Norteamérica", "EDT": "Horario de verán do leste, Norteamérica", "HNEG": "Horario estándar de Groenlandia Oriental", "MESZ": "Horario de verán de Europa Central", "HAT": "Horario de verán de Terranova", "TMT": "Horario estándar de Turcomenistán", "HECU": "Horario de verán de Cuba", "ARST": "Horario de verán da Arxentina", "AWDT": "Horario de verán de Australia Occidental", "AEDT": "Horario de verán de Australia Oriental", "WIB": "Horario de Indonesia Occidental", "WART": "Horario estándar da Arxentina Occidental"},
	}
}
907815
func (s *Storage) BlobrefStrings() []string {
	s.mu.RLock()
	defer s.mu.RUnlock()
	sorted := make([]string, 0, len(s.m))
	for br := range s.m {
		sorted = append(sorted, br.String())
	}
	sort.Strings(sorted)
	return sorted
}
1356343
func NewMapper(opt Option) *Mapper {
	if opt.NameFunc == nil {
		opt.NameFunc = ToUpperCamelCase
	}
	if opt.TagName == "" {
		opt.TagName = "gluamapper"
	}
	return &Mapper{opt}
}
1268370
func New(oldnew ...string) *Replacer {
	if len(oldnew)%2 == 1 {
		panic("bytes.NewReplacer: odd argument count")
	}

	allNewBytes := true
	for i := 0; i < len(oldnew); i += 2 {
		if len(oldnew[i]) != 1 {
			return &Replacer{r: makeGenericReplacer(oldnew)}
		}
		if len(oldnew[i+1]) != 1 {
			allNewBytes = false
		}
	}

	if allNewBytes {
		r := byteReplacer{}
		for i := range r {
			r[i] = byte(i)
		}
		// The first occurrence of old->new map takes precedence
		// over the others with the same old string.
		for i := len(oldnew) - 2; i >= 0; i -= 2 {
			o := oldnew[i][0]
			n := oldnew[i+1][0]
			r[o] = n
		}
		return &Replacer{r: &r}
	}

	return &Replacer{r: makeGenericReplacer(oldnew)}
}
207958
func trimGlobs(g1, g2 Glob) (Glob, Glob, bool) {
	var l, r1, r2 int

	// Trim from the beginning until a flagged Token or a mismatch is found.
	for l = 0; l < len(g1) && l < len(g2) && g1[l].Flag() == FlagNone && g2[l].Flag() == FlagNone; l++ {
		if !Match(g1[l], g2[l]) {
			return nil, nil, false
		}
	}

	// Leave one prefix Token untrimmed to avoid empty Globs because those will break the algorithm.
	if l > 0 {
		l--
	}

	// Trim from the end until a flagged Token or a mismatch is found.
	for r1, r2 = len(g1)-1, len(g2)-1; r1 >= 0 && r1 >= l && r2 >= 0 && r2 >= l && g1[r1].Flag() == FlagNone && g2[r2].Flag() == FlagNone; r1, r2 = r1-1, r2-1 {
		if !Match(g1[r1], g2[r2]) {
			return nil, nil, false
		}
	}

	// Leave one suffix Token untrimmed to avoid empty Globs because those will break the algorithm.
	if r1 < len(g1)-1 {
		r1++
		r2++
	}

	return g1[l : r1+1], g2[l : r2+1], true
}
1026654
func EncodeGob(obj map[interface{}]interface{}) ([]byte, error) {
	for _, v := range obj {
		gob.Register(v)
	}
	buf := bytes.NewBuffer(nil)
	enc := gob.NewEncoder(buf)
	err := enc.Encode(obj)
	if err != nil {
		return []byte(""), err
	}
	return buf.Bytes(), nil
}
538637
func NewConfigLoader(file *os.File) *ConfigLoader {
	return &ConfigLoader{conf: file, separator: DefaultSeparator}
}
1256467
func Compile(pattern string, options *Options) (Glob, error) {
	pattern = strings.TrimSpace(pattern)
	reader := strings.NewReader(pattern)

	if options == nil {
		options = DefaultOptions
	} else {
		// Check that the separator is not an expander
		for _, expander := range expanders {
			if options.Separator == expander {
				return nil, fmt.Errorf("'%s' is not allowed as a separator", string(options.Separator))
			}
		}
	}

	state := &parserState{
		options:          options,
		escapedSeparator: escapeRegexComponent(string(options.Separator)),
		processedTokens:  make([]processedToken, 0, 10),
	}
	glob := &globImpl{
		Regexp:      nil,
		globPattern: pattern,
		negated:     false,
		parserState: state,
	}

	regexBuf := new(bytes.Buffer)
	if options.MatchAtStart {
		regexBuf.WriteRune('^')
	}

	var err error
	// Transform into a regular expression pattern
	// 1. Parse negation prefixes
	err = parseNegation(reader, glob)
	if err != nil {
		return nil, err
	}

	// 2. Tokenise and convert!
	tokeniser := newGlobTokeniser(reader, options)
	lastProcessedToken := &processedToken{}
	for tokeniser.Scan() {
		if err = tokeniser.Err(); err != nil {
			return nil, err
		}

		token, tokenType := tokeniser.Token()
		t := processedToken{
			contents:  nil,
			tokenType: tokenType,
		}

		// Special cases
		if tokenType == tcGlobStar && tokeniser.Peek() {
			// If this is a globstar and the next token is a separator, consume it (the globstar pattern itself includes
			// a separator)
			if err = tokeniser.PeekErr(); err != nil {
				return nil, err
			}
			_, peekedType := tokeniser.PeekToken()
			if peekedType == tcSeparator {
				tokeniser.Scan()
			}
		}
		if tokenType == tcGlobStar && lastProcessedToken.tokenType == tcGlobStar {
			// If the last token was a globstar and this is too, remove the last. We don't remove this globstar because
			// it may now be the last in the pattern, which is special
			lastProcessedToken = popLastToken(state)
		}
		if tokenType == tcGlobStar && lastProcessedToken.tokenType == tcSeparator && !tokeniser.Peek() {
			// If this is the last token, and it's a globstar, remove a preceeding separator
			lastProcessedToken = popLastToken(state)
		}

		t.contents, err = processToken(token, tokenType, glob, tokeniser)
		if err != nil {
			return nil, err
		}

		lastProcessedToken = &t
		state.processedTokens = append(state.processedTokens, t)
	}

	for _, t := range state.processedTokens {
		t.contents.WriteTo(regexBuf)
	}

	if options.MatchAtEnd {
		regexBuf.WriteRune('$')
	}

	regexString := regexBuf.String()
	Logger.Tracef("[ohmyglob:Glob] Compiled \"%s\" to regex `%s` (negated: %v)", pattern, regexString, glob.negated)
	re, err := regexp.Compile(regexString)
	if err != nil {
		return nil, err
	}

	glob.parserState = nil
	glob.Regexp = re

	return glob, nil
}
1100847
func (c *Configuration) FindGlobal(key string) string {
	output, _ := c.gitConfig("--global", key)
	return output
}
415702
func Glob(pattern string) (matches []string, err error) {
	if !hasMeta(pattern) {
		if _, err = os.Lstat(pattern); err != nil {
			return nil, nil
		}
		return []string{pattern}, nil
	}
	dir, file := filepath.Split(pattern)
	switch dir {
	case "":
		dir = "."
	case string(filepath.Separator):
		// nothing
	default:
		dir = dir[0 : len(dir)-1] // chop off trailing separator
	}
	if !hasMeta(dir) {
		return glober(dir, file, nil)
	}
	var m []string
	m, err = Glob(dir)
	if err != nil {
		return
	}
	for _, d := range m {
		matches, err = glober(d, file, matches)
		if err != nil {
			return
		}
	}
	return
}
1359498
func NewGzip() *Gzip {
	gz := new(Gzip)
	gz.Options = new(Options)
	return gz
}
613391
func NewGzipCompressionLevel(level int) Compression {
	return &genericCompression{
		wf: func(w io.Writer) (io.WriteCloser, error) { return gzip.NewWriterLevel(w, level) },
		rf: func(r io.Reader) (io.ReadCloser, error) { return gzip.NewReader(r) },
	}
}
874046
func glob(fs Fs, dir, pattern string, matches []string) (m []string, e error) {
	m = matches
	fi, err := fs.Stat(dir)
	if err != nil {
		return
	}
	if !fi.IsDir() {
		return
	}
	d, err := fs.Open(dir)
	if err != nil {
		return
	}
	defer d.Close()

	names, _ := d.Readdirnames(-1)
	sort.Strings(names)

	for _, n := range names {
		matched, err := filepath.Match(pattern, n)
		if err != nil {
			return m, err
		}
		if matched {
			m = append(m, filepath.Join(dir, n))
		}
	}
	return
}
868136
func (l *lexer) blob() string {
	return l.input[l.start:l.pos]
}
308739
func (c *Context) GlobalBoolT(name string) bool {
	if fs := lookupGlobalFlagSet(name, c); fs != nil {
		return lookupBoolT(name, fs)
	}
	return false
}
1098351
func CompileGlob(pat string) (glob Glob, err error) {
	pat = toSlash(pat)
	s, err := translateGlob(pat)
	if err != nil {
		return
	}
	r, err := regexp.Compile(s)
	if err != nil {
		return
	}
	glob = Glob{pat, r}
	return
}