示例#1
0
        /// <summary>The <see cref="NegationArgNode"/> visit implementation</summary>
        /// <param name="negationArgNode">The negation arg node.</param>
        /// <returns>The modified AST node if modified otherwise the original node</returns>
        public override AstNode VisitNegationArgNode(NegationArgNode negationArgNode)
        {
            // negation_arg
            // : type_selector | universal | HASH | class | attrib | pseudo
            // ;
            if (negationArgNode.TypeSelectorNode != null)
            {
                negationArgNode.TypeSelectorNode.Accept(this);
            }
            else if (negationArgNode.UniversalSelectorNode != null)
            {
                negationArgNode.UniversalSelectorNode.Accept(this);
            }
            else if (!string.IsNullOrWhiteSpace(negationArgNode.Hash))
            {
                _printerFormatter.Append(negationArgNode.Hash);
            }
            else if (!string.IsNullOrWhiteSpace(negationArgNode.CssClass))
            {
                _printerFormatter.Append(negationArgNode.CssClass);
            }
            else if (negationArgNode.AttribNode != null)
            {
                negationArgNode.AttribNode.Accept(this);
            }
            else if (negationArgNode.PseudoNode != null)
            {
                negationArgNode.PseudoNode.Accept(this);
            }

            return(negationArgNode);
        }
 /// <summary>The <see cref="NegationArgNode"/> visit implementation</summary>
 /// <param name="negationArgNode">The negation arg node.</param>
 /// <returns>The modified AST node if modified otherwise the original node</returns>
 public override AstNode VisitNegationArgNode(NegationArgNode negationArgNode)
 {
     return(new NegationArgNode(
                negationArgNode.TypeSelectorNode != null ? (TypeSelectorNode)negationArgNode.TypeSelectorNode.Accept(this) : null,
                negationArgNode.UniversalSelectorNode != null ? (UniversalSelectorNode)negationArgNode.UniversalSelectorNode.Accept(this) : null,
                negationArgNode.Hash,
                negationArgNode.CssClass,
                negationArgNode.AttribNode != null ? (AttribNode)negationArgNode.AttribNode.Accept(this) : null,
                negationArgNode.PseudoNode != null ? (PseudoNode)negationArgNode.PseudoNode.Accept(this) : null));
 }
示例#3
0
 /// <summary>The <see cref="NegationArgNode"/> visit implementation</summary>
 /// <param name="negationArgNode">The negation arg node.</param>
 /// <returns>The modified AST node if modified otherwise the original node</returns>
 public virtual AstNode VisitNegationArgNode(NegationArgNode negationArgNode)
 {
     return(negationArgNode);
 }