//
// Functions
//
// wasFuncCall returns true if given expression was a function call
356860
func (v *evalVisitor) wasFuncCall(node *ast.Expression) bool {
	// check if expression was tagged as a function call
	return v.exprFunc[node]
}
855767
public static boolean isFunctionOfType(Expression expr, FunctionDefinition.Type type) {
		return expr instanceof CallExpression &&
			((CallExpression) expr).getFunctionDefinition().getType() == type;
	}
1314787
function isFunctionExpression(node) {
    if (node && node.callee && node.callee.type === 'FunctionExpression') {
        return true;
    }
    return false;
}
29229
func (g *Group) IfFunc(f func(*Group)) *Statement {
	s := IfFunc(f)
	g.items = append(g.items, s)
	return s
}
201671
func (v *evalVisitor) callFunc(name string, funcVal reflect.Value, options *Options) reflect.Value {
	params := options.Params()

	funcType := funcVal.Type()

	// @todo Is there a better way to do that ?
	strType := reflect.TypeOf("")
	boolType := reflect.TypeOf(true)

	// check parameters number
	addOptions := false
	numIn := funcType.NumIn()

	if numIn == len(params)+1 {
		lastArgType := funcType.In(numIn - 1)
		if reflect.TypeOf(options).AssignableTo(lastArgType) {
			addOptions = true
		}
	}

	if !addOptions && (len(params) != numIn) {
		v.errorf("Helper '%s' called with wrong number of arguments, needed %d but got %d", name, numIn, len(params))
	}

	// check and collect arguments
	args := make([]reflect.Value, numIn)
	for i, param := range params {
		arg := reflect.ValueOf(param)
		argType := funcType.In(i)

		if !arg.IsValid() {
			if canBeNil(argType) {
				arg = reflect.Zero(argType)
			} else if argType.Kind() == reflect.String {
				arg = reflect.ValueOf("")
			} else {
				// @todo Maybe we can panic on that
				return reflect.Zero(strType)
			}
		}

		if !arg.Type().AssignableTo(argType) {
			if strType.AssignableTo(argType) {
				// convert parameter to string
				arg = reflect.ValueOf(strValue(arg))
			} else if boolType.AssignableTo(argType) {
				// convert parameter to bool
				val, _ := isTrueValue(arg)
				arg = reflect.ValueOf(val)
			} else {
				v.errorf("Helper %s called with argument %d with type %s but it should be %s", name, i, arg.Type(), argType)
			}
		}

		args[i] = arg
	}

	if addOptions {
		args[numIn-1] = reflect.ValueOf(options)
	}

	result := funcVal.Call(args)

	return result[0]
}
256669
func (d *domainClient) CallFunctionOn(ctx context.Context, args *CallFunctionOnArgs) (reply *CallFunctionOnReply, err error) {
	reply = new(CallFunctionOnReply)
	if args != nil {
		err = rpcc.Invoke(ctx, "Runtime.callFunctionOn", args, reply, d.conn)
	} else {
		err = rpcc.Invoke(ctx, "Runtime.callFunctionOn", nil, reply, d.conn)
	}
	if err != nil {
		err = &internal.OpError{Domain: "Runtime", Op: "CallFunctionOn", Err: err}
	}
	return
}
987844
func (g *genericFunc) Call(params ...interface{}) interface{} {
	paramsIn := make([]reflect.Value, len(params))
	for i, param := range params {
		paramsIn[i] = reflect.ValueOf(param)
	}
	paramsOut := g.Cache.FnValue.Call(paramsIn)
	if len(paramsOut) >= 1 {
		return paramsOut[0].Interface()
	}
	return nil
}
962114
function isCallWithFunctionExpression(node) {
  const callObj = isMemberExpression(node.callee) ? node.callee.object : node;
  const firstArg = callObj.arguments ? callObj.arguments[0] : null;
  return callObj !== undefined && isCallExpression(callObj) &&
    firstArg && isFunctionExpression(firstArg);
}
720393
public static function isFunctionCall($function_name) {
    $function_names = func_get_args();

    return function ($node) use ($function_names) {
      if ($node instanceof FunctionCallNode) {
        return in_array($node->getName()->getText(), $function_names, TRUE);
      }
      return FALSE;
    };
  }
1072600
function isInFunctionalCall(lex) {
            // in a call, or inside array or object brackets that are inside a function.
            return (lex && (lex.info === "call" ||
                (lex.info === undefined && (lex.type === "]" || lex.type === "}") &&
                    lex.prev.info === "call")));
        }
89411
func (t *Tree) hasFunction(name string) bool {
	for _, funcMap := range t.funcs {
		if funcMap == nil {
			continue
		}
		if funcMap[name] != nil {
			return true
		}
	}
	return false
}
777812
function isCallback(node) {
            return containsOnlyIdentifiers(node.callee) && callbacks.indexOf(sourceCode.getText(node.callee)) > -1;
        }
942843
func functions(t *cc.TranslationUnit) ([]bg.Declaration, error) {
	filter := func(d *cc.Declarator) bool {
		if d.Type.Kind() != cc.Function {
			return false
		}
		return true
	}
	return bg.Get(t, filter)
}
379999
func (c *call) HasUndefined() bool {
	for i := range c.Args {
		if c.Args[i] == nil {
			return true
		}
		if basic, ok := c.Args[i].(*types.Basic); ok {
			if basic.Kind() == types.Invalid {
				return true
			}
		}
		if strings.Index(c.Args[i].String(), "invalid type") >= 0 {
			return true
		}
	}
	return false
}
1291922
func interpolationFuncContains() ast.Function {
	return ast.Function{
		ArgTypes:   []ast.Type{ast.TypeList, ast.TypeString},
		ReturnType: ast.TypeBool,
		Callback: func(args []interface{}) (interface{}, error) {
			_, err := interpolationFuncIndex().Callback(args)
			if err != nil {
				return false, nil
			}
			return true, nil
		},
	}
}
688703
func isDFunction(n *ast.CallExpr) bool {
	ident, is := n.Fun.(*ast.Ident)
	if !is {
		return false
	}
	return ident.Name == "D"
}
56147
func IsFunc(kindable interface {
	Kind() reflect.Kind
}) bool {
	return kindable.Kind() == reflect.Func
}