Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Side by Side Diff: pkg/analyzer_experimental/lib/src/services/formatter_impl.dart

Issue 18487005: Initial indent fix and a few more tests. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analyzer_experimental/lib/src/services/writer.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library formatter_impl; 5 library formatter_impl;
6 6
7 7
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import 'package:analyzer_experimental/analyzer.dart'; 10 import 'package:analyzer_experimental/analyzer.dart';
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 139
140 /// An AST visitor that drives formatting heuristics. 140 /// An AST visitor that drives formatting heuristics.
141 class SourceVisitor implements ASTVisitor { 141 class SourceVisitor implements ASTVisitor {
142 142
143 /// The writer to which the source is to be written. 143 /// The writer to which the source is to be written.
144 SourceWriter writer; 144 SourceWriter writer;
145 145
146 /// Initialize a newly created visitor to write source code representing 146 /// Initialize a newly created visitor to write source code representing
147 /// the visited nodes to the given [writer]. 147 /// the visited nodes to the given [writer].
148 SourceVisitor(FormatterOptions options) : 148 SourceVisitor(FormatterOptions options) :
149 writer = new SourceWriter(initialIndent: options.initialIndentationLevel, 149 writer = new SourceWriter(indentCount: options.initialIndentationLevel,
150 lineSeparator: options.lineSeparator); 150 lineSeparator: options.lineSeparator);
151 151
152 visitAdjacentStrings(AdjacentStrings node) { 152 visitAdjacentStrings(AdjacentStrings node) {
153 visitList(node.strings, ' '); 153 visitList(node.strings, ' ');
154 } 154 }
155 155
156 visitAnnotation(Annotation node) { 156 visitAnnotation(Annotation node) {
157 writer.print('@'); 157 writer.print('@');
158 visit(node.name); 158 visit(node.name);
159 visitPrefixed('.', node.constructorName); 159 visitPrefixed('.', node.constructorName);
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 if (i > 0) { 936 if (i > 0) {
937 writer.print(separator); 937 writer.print(separator);
938 } 938 }
939 nodes[i].accept(this); 939 nodes[i].accept(this);
940 } 940 }
941 } 941 }
942 } 942 }
943 } 943 }
944 944
945 } 945 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer_experimental/lib/src/services/writer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698