// AddFuncRegexp adds a minify function to the mimetype => function map (unsafe for concurrent use).
513629
func (m *M) AddFuncRegexp(pattern *regexp.Regexp, minifier MinifierFunc) {
	m.mutex.Lock()
	m.pattern = append(m.pattern, patternMinifier{pattern, minifier})
	m.mutex.Unlock()
}
352955
func (b *Base) AddFunc(key string, f ValueConverter) Serializer {
	return b.AddFuncIf(alwaysTrue, key, f)
}
627428
func TemplateFunc(name string, f interface{}) TemplateOption {
	return func(g Generator, t *template.Template) *template.Template {
		return t.Funcs(template.FuncMap{name: curryGenerator(f, g)})
	}
}
569307
func AddNewOutputFunc(name string, f NewOutputFunc) bool {
	updateMutex.Lock()
	defer updateMutex.Unlock()
	return lockedAddNewOutputFunc(name, f)
}
211598
func addValueFuncs(out map[string]reflect.Value, in FuncMap) {
	for name, fn := range in {
		v := reflect.ValueOf(fn)
		if v.Kind() != reflect.Func {
			panic("value for " + name + " not a function")
		}
		if !goodFunc(v.Type()) {
			panic(fmt.Errorf("can't install method/function %q with %d results", name, v.Type().NumOut()))
		}
		out[name] = v
	}
}
285177
func (v *View) AddFunc(funcName string, funcBody interface{}) {
	for i, n := 0, len(v.engines); i < n; i++ {
		e := v.engines[i]
		if engineFuncer, ok := e.(EngineFuncer); ok {
			engineFuncer.AddFunc(funcName, funcBody)
		}
	}
}
1000264
func NewRegexpQuery(name string, regexp string) RegexpQuery {
	return RegexpQuery{name: name, regexp: regexp}
}
1118400
func (fp *formatParser) addFormatFunc(
	f func(*LineData, *bytes.Buffer) error, size int,
) {
	fp.commitStatic()
	fp.formatFuncs = append(fp.formatFuncs, f)
	fp.initialSize += size
}
162799
func addConversionFuncs(scheme *runtime.Scheme) error {
	err := scheme.AddConversionFuncs(
		Convert_scheme_ScaleStatus_To_v1beta2_ScaleStatus,
		Convert_v1beta2_ScaleStatus_To_scheme_ScaleStatus,
	)
	if err != nil {
		return err
	}

	return nil
}
755444
func NewRegexpMap() *RegexpMap {
	return &RegexpMap{
		lookupValues:  make(map[string]*RegexpList),
		rules:         make(map[string]*regexp.Regexp),
		rulesRelation: make(map[string]refCount),
	}
}
122929
func (v *Validate) RegisterCustomTypeFunc(fn CustomTypeFunc, types ...interface{}) {

	if v.customFuncs == nil {
		v.customFuncs = make(map[reflect.Type]CustomTypeFunc)
	}

	for _, t := range types {
		v.customFuncs[reflect.TypeOf(t)] = fn
	}

	v.hasCustomFuncs = true
}
1141860
func (alias *AliasPackage) AddFunc(decl *ast.FuncDecl) (err error) {

	if decl == nil {
		err = errUnexpectedNil
		return
	}

	paramNames := collection.AsEnumerable(decl.Type.Params.List)
	paramNames = collection.SelectMany(paramNames, func(x interface{}) collection.Enumerator {
		return collection.AsEnumerable(x.(*ast.Field).Names).Enumerate(nil)
	})

	arguments := []ast.Expr{}

	for n := range paramNames.Enumerate(nil) {
		arguments = append(arguments, n.(*ast.Ident))
	}

	decl.Body = &ast.BlockStmt{
		List: []ast.Stmt{
			&ast.ReturnStmt{
				Results: []ast.Expr{
					&ast.CallExpr{
						Fun: &ast.SelectorExpr{
							X: &ast.Ident{
								Name: origImportAlias,
							},
							Sel: &ast.Ident{
								Name: decl.Name.Name,
							},
						},
						Args: arguments,
					},
				},
			},
		},
	}

	targetFile := alias.ModelFile()

	targetFile.Decls = append(targetFile.Decls, decl)

	return
}
568083
func (s *Scheme) AddFieldLabelConversionFunc(version, kind string, conversionFunc FieldLabelConversionFunc) error {
	if s.fieldLabelConversionFuncs[version] == nil {
		s.fieldLabelConversionFuncs[version] = map[string]FieldLabelConversionFunc{}
	}

	s.fieldLabelConversionFuncs[version][kind] = conversionFunc
	return nil
}
1329332
func (l *Lexer) findRegexp(r *regexp.Regexp) string {
	return r.FindString(l.input[l.pos:])
}
83720
func (f *Footer) AddRef() {
	f.m.Lock()
	f.refs++
	f.m.Unlock()
}
1051545
func (p Parameter) ConvertFuncExpr() (string, error) {
	tbl := proto3ConvertFuncs
	if !p.IsProto2() && p.IsRepeated() {
		tbl = proto3RepeatedConvertFuncs
	} else if p.IsProto2() && !p.IsRepeated() {
		tbl = proto2ConvertFuncs
	} else if p.IsProto2() && p.IsRepeated() {
		tbl = proto2RepeatedConvertFuncs
	}
	typ := p.Target.GetType()
	conv, ok := tbl[typ]
	if !ok {
		conv, ok = wellKnownTypeConv[p.Target.GetTypeName()]
	}
	if !ok {
		return "", fmt.Errorf("unsupported field type %s of parameter %s in %s.%s", typ, p.FieldPath, p.Method.Service.GetName(), p.Method.GetName())
	}
	return conv, nil
}
842287
func (b ValExprBuilder) RegExp(val interface{}) BoolExprBuilder {
	return b.makeComparisonExpr(astRegExp, makeValExpr(val))
}