예제 #1
0
        public void ShoulHandleNullArgument()
        {
            var call   = new CallToken(null);
            var group  = new GroupToken(null);
            var lambda = new LambdaToken(null);
            var obj    = new ObjectToken(null);
            var array  = new ArrayToken(null);

            Assert.NotNull(call.Args);
            Assert.NotNull(group.Tokens);
            Assert.NotNull(lambda.Parameters);
            Assert.NotNull(obj.Members);
            Assert.NotNull(array.Items);
        }
예제 #2
0
        protected virtual Expression VisitCall(CallToken token, IEnumerable <ParameterExpression> parameters)
        {
            Expression owner;
            string     methodName;

            if (token.Callee is MemberToken mt)
            {
                owner      = Visit(mt.Owner, parameters);
                methodName = mt.Name;
            }
            else if (token.Callee is VariableToken vt && parameters.Count() == 1)
            {
                owner      = parameters.First();
                methodName = vt.Name;
            }