/// <summary>The <see cref="DocumentQueryNode"/> visit implementation</summary> /// <param name="documentQueryNode">The document AST node</param> /// <returns>The modified AST node if modified otherwise the original node</returns> public override AstNode VisitDocumentQueryNode(DocumentQueryNode documentQueryNode) { return(new DocumentQueryNode( documentQueryNode.MatchFunctionName, documentQueryNode.DocumentSymbol, documentQueryNode.Rulesets.Select(ruleset => (RulesetNode)ruleset.Accept(this)).ToSafeReadOnlyCollection())); }
/// <summary> /// The <see cref="DocumentQueryNode"/> visit implementation for print. /// </summary> /// <param name="documentQueryNode">The document query node</param> /// <returns>The modified AST node if modified otherwise the original node</returns> public override AstNode VisitDocumentQueryNode(DocumentQueryNode documentQueryNode) { _printerFormatter.Append(documentQueryNode.DocumentSymbol); _printerFormatter.Append(CssConstants.SingleSpace); _printerFormatter.Append(documentQueryNode.MatchFunctionName); _printerFormatter.AppendLine(); _printerFormatter.AppendLine(CssConstants.OpenCurlyBracket); _printerFormatter.IncrementIndentLevel(); foreach (var ruleset in documentQueryNode.Rulesets) { ruleset.Accept(this); } _printerFormatter.DecrementIndentLevel(); _printerFormatter.AppendLine(CssConstants.CloseCurlyBracket); return(documentQueryNode); }
/// <summary>The <see cref="DocumentQueryNode"/> visit implementation</summary> /// <param name="documentQueryNode">The DocumentQueryNode to visit.</param> /// <returns>The modified AST node if modified otherwise the original node</returns> public virtual AstNode VisitDocumentQueryNode(DocumentQueryNode documentQueryNode) { return(documentQueryNode); }