Example #1
0
 public override bool Walk(Var node) { AddNode(node); return true; }
 public override bool Walk(Var node) {
     CheckStatement(node);
     return base.Walk(node);
 }
 public override bool Walk(Var node)
 {
     if (node != null)
     {
         for (var ndx = 0; ndx < node.Count; ++ndx)
         {
             var decl = node[ndx];
             if (decl != null)
             {
                 decl.Walk(this);
             }
         }
     }
     return false;
 }
Example #4
0
        public override bool Walk(Var node) {
            ReplaceFollowingWhiteSpace(node.GetStartIndex(_tree.LocationResolver) + "var".Length, " ");

            if (node.Count > 0) {

                FormatVariableDeclaration(node[0]);

                IndentSpaces(4);
                for (int i = 1; i < node.Count; i++) {
                    var curDecl = node[i];

                    ReplacePreceedingWhiteSpaceMaybeMultiline(curDecl.GetSpan(_tree.LocationResolver).Start);

                    FormatVariableDeclaration(curDecl);
                }
                DedentSpaces(4);

                if (!node[node.Count - 1].HasInitializer) {
                    // if we have an initializer the whitespace was
                    // cleared between the end of the initializer and the
                    // semicolon
                    RemoveSemiColonWhiteSpace(node.GetEndIndex(_tree.LocationResolver));
                }
            }

            return false;
        }