private List <Expr> GetAllMethodArguments(Expr.Apply apply, String methodName) { var methodArgs = new List <Expr>(); if (apply.typ.FullName.Equals(methodName)) { if (apply.callee.IsApply) { var callee = (Expr.Apply)apply.callee; if (callee.kind.IsApplyMeth) { methodArgs.AddRange(GetAllMethodArguments((Expr.Apply)apply.callee, methodName)); } } } methodArgs.AddRange(apply.args); return(methodArgs); }
private Expr GetFunctionExpression(Expr.Apply apply) { var testObject = apply.callee; while (testObject.Type.IsPrimitiveType && !testObject.IsValue) { testObject = ((Expr.Apply)testObject).callee; } if (testObject.IsValue) { var value = ((Expr.Value)testObject).value; if (!value.IsIdentValue || value.Type.IsUnknownType) { return(apply.callee); } } return(testObject); }