Exemplo n.º 1
0
 public override bool Walk(GroupingOperator node)
 {
     if (node != null)
     {
         if (node.Operand != null)
         {
             node.Operand.Walk(this);
         }
     }
     return(false);
 }
Exemplo n.º 2
0
 public override bool Walk(GroupingOperator node) { AddNode(node); return true; }
 public override bool Walk(GroupingOperator node)
 {
     if (node != null)
     {
         if (node.Operand != null)
         {
             node.Operand.Walk(this);
         }
     }
     return false;
 }
Exemplo n.º 4
0
        public override bool Walk(GroupingOperator node) {
            ReplaceFollowingWhiteSpace(
                node.GetStartIndex(_tree.LocationResolver) + 1,
                _options.SpaceAfterOpeningAndBeforeClosingNonEmptyParenthesis ? " " : ""
            );

            if (node.Operand != null) {
                node.Operand.Walk(this);
            }

            // Format the indentation of the block along with whitespace.
            bool isMultiLine = ContainsLineFeed(node.GetStartIndex(_tree.LocationResolver), node.GetEndIndex(_tree.LocationResolver));
            if (isMultiLine && node.Operand == null) {
                ReplacePreceedingIncludingNewLines(node.GetEndIndex(_tree.LocationResolver) - 1, ReplaceWith.InsertNewLineAndIndentation, replaceOnNewLine: true);
            } else {
                ReplacePreceedingWhiteSpace(
                    node.GetEndIndex(_tree.LocationResolver) - 1,
                    _options.SpaceAfterOpeningAndBeforeClosingNonEmptyParenthesis ? " " : ""
                );
            }

            return false;
        }