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

Side by Side Diff: lib/src/dart_formatter.dart

Issue 844653002: Format enums. Fix #120. (Closed) Base URL: https://github.com/dart-lang/dart_style.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « no previous file | lib/src/source_visitor.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 dart_style.src.code_formatter; 5 library dart_style.src.code_formatter;
6 6
7 import 'package:analyzer/src/string_source.dart'; 7 import 'package:analyzer/src/string_source.dart';
8 import 'package:analyzer/src/generated/parser.dart'; 8 import 'package:analyzer/src/generated/parser.dart';
9 import 'package:analyzer/src/generated/scanner.dart'; 9 import 'package:analyzer/src/generated/scanner.dart';
10 import 'package:analyzer/src/generated/source.dart'; 10 import 'package:analyzer/src/generated/source.dart';
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 } else { 140 } else {
141 lineEnding = "\n"; 141 lineEnding = "\n";
142 } 142 }
143 } 143 }
144 144
145 errorListener.throwIfErrors(); 145 errorListener.throwIfErrors();
146 146
147 // Parse it. 147 // Parse it.
148 var parser = new Parser(stringSource, errorListener); 148 var parser = new Parser(stringSource, errorListener);
149 parser.parseAsync = true; 149 parser.parseAsync = true;
150 parser.parseEnum = true;
pquitslund 2015/01/08 04:49:25 Depending on what version of the analyzer we're pu
Bob Nystrom 2015/01/08 17:35:35 Right now dart_style is constrained to an older ve
150 151
151 var node; 152 var node;
152 if (source.isCompilationUnit) { 153 if (source.isCompilationUnit) {
153 node = parser.parseCompilationUnit(startToken); 154 node = parser.parseCompilationUnit(startToken);
154 } else { 155 } else {
155 node = parser.parseStatement(startToken); 156 node = parser.parseStatement(startToken);
156 } 157 }
157 158
158 errorListener.throwIfErrors(); 159 errorListener.throwIfErrors();
159 160
160 // Format it. 161 // Format it.
161 var visitor = new SourceVisitor(this, lineInfo, source); 162 var visitor = new SourceVisitor(this, lineInfo, source);
162 return visitor.run(node); 163 return visitor.run(node);
163 } 164 }
164 } 165 }
OLDNEW
« no previous file with comments | « no previous file | lib/src/source_visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698