TinyEE.DLRUtil.GetBinaryBinder C# (CSharp) Method

GetBinaryBinder() static private method

static private GetBinaryBinder ( TokenType tokenType ) : System.Runtime.CompilerServices.CallSiteBinder
tokenType TokenType
return System.Runtime.CompilerServices.CallSiteBinder
        internal static CallSiteBinder GetBinaryBinder(TokenType tokenType)
        {
            return Binder.BinaryOperation(CSharpBinderFlags.CheckedContext, GetExpressionType(tokenType), null, GetArgInfo(2));
        }

Usage Example

Exemplo n.º 1
0
        private static Expression GetCompareAST(IList <ParseNode> nodes, int start, Expression context, Expression chain = null)
        {
            //Rewrite chained compare expressions to chained AND expressions, e.g. 5>4>3> --> 5>4 AND 4>3
            Debug.Assert(nodes.Count >= 3 && nodes.Count % 2 == 1);
            Expression result;

            if (start == 0)
            {
                result = chain;
            }
            else
            {
                var link = Expression.Dynamic(DLRUtil.GetBinaryBinder(nodes[start - 1].Token.Type),
                                              typeof(object),
                                              nodes[start - 2].GetAST(context),
                                              nodes[start].GetAST(context));
                chain = chain != null
                            ? Expression.Dynamic(DLRUtil.GetBinaryBinder(TokenType.AND),
                                                 typeof(object),
                                                 link,
                                                 chain)
                            : link;

                result = GetCompareAST(nodes, start - 2, context, chain);
            }
            return(result);
        }
All Usage Examples Of TinyEE.DLRUtil::GetBinaryBinder