예제 #1
0
        public static Expression CombineWithComma(IndexSpan span, JSParser parser, Expression operand1, Expression operand2)
        {
            var comma = new CommaOperator(parser.EncodeSpan(span));

            List <Expression> res   = new List <Expression>();
            CommaOperator     left  = operand1 as CommaOperator;
            CommaOperator     right = operand2 as CommaOperator;

            if (left != null)
            {
                res.AddRange(left.Expressions);
            }
            else
            {
                res.Add(operand1);
            }

            if (right != null)
            {
                res.AddRange(right.Expressions);
            }
            else
            {
                res.Add(operand2);
            }
            comma.Expressions = res.ToArray();
            return(comma);
        }
예제 #2
0
        public static Expression CombineWithComma(IndexSpan span, JSParser parser, Expression operand1, Expression operand2)
        {
            var comma = new CommaOperator(parser.EncodeSpan(span));

            List<Expression> res = new List<Expression>();
            CommaOperator left = operand1 as CommaOperator;
            CommaOperator right = operand2 as CommaOperator;
            if (left != null)
            {
                res.AddRange(left.Expressions);
            }
            else
            {
                res.Add(operand1);
            }

            if (right != null)
            {
                res.AddRange(right.Expressions);
            }
            else
            {
                res.Add(operand2);
            }
            comma.Expressions = res.ToArray();
            return comma;
        }