System.Xml.Xsl.Xslt.XPathPatternBuilder.Operator C# (CSharp) Method

Operator() public method

public Operator ( XPathOperator op, QilNode left, QilNode right ) : QilNode
op XPathOperator
left QilNode
right QilNode
return QilNode
        public QilNode Operator(XPathOperator op, QilNode left, QilNode right) {
            Debug.Assert(op == XPathOperator.Union);
            Debug.Assert(left  != null);
            Debug.Assert(right != null);
            // It is important to not create nested lists here
            Debug.Assert(right.NodeType == QilNodeType.Filter, "LocationPathPattern must be compiled into a filter");
            if (left.NodeType == QilNodeType.Sequence) {
                ((QilList)left).Add(right);
                return left;
            } else {
                Debug.Assert(left.NodeType == QilNodeType.Filter, "LocationPathPattern must be compiled into a filter");
                return f.Sequence(left, right);
            }
        }