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

Side by Side Diff: pkg/analyzer_experimental/bin/formatter.dart

Issue 24180004: Source selection API abstraction first cut. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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/formatter_impl.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 #!/usr/bin/env dart 1 #!/usr/bin/env dart
2 2
3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
4 // for details. All rights reserved. Use of this source code is governed by a 4 // for details. All rights reserved. Use of this source code is governed by a
5 // BSD-style license that can be found in the LICENSE file. 5 // BSD-style license that can be found in the LICENSE file.
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 import 'dart:utf'; 8 import 'dart:utf';
9 9
10 import 'package:args/args.dart'; 10 import 'package:args/args.dart';
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 'standard output.') 109 'standard output.')
110 ..write('\n\n') 110 ..write('\n\n')
111 ..write('Supported flags are:') 111 ..write('Supported flags are:')
112 ..write('Usage: $BINARY_NAME [flags] [path...]\n\n') 112 ..write('Usage: $BINARY_NAME [flags] [path...]\n\n')
113 ..write('${argParser.getUsage()}\n\n'); 113 ..write('${argParser.getUsage()}\n\n');
114 _log(buffer.toString()); 114 _log(buffer.toString());
115 } 115 }
116 116
117 /// Format the given [src] as a compilation unit. 117 /// Format the given [src] as a compilation unit.
118 String _formatCU(src, {options: const FormatterOptions()}) => 118 String _formatCU(src, {options: const FormatterOptions()}) =>
119 new CodeFormatter(options).format(CodeKind.COMPILATION_UNIT, src); 119 new CodeFormatter(options).format(CodeKind.COMPILATION_UNIT, src).source;
120 120
121 /// Log the given [msg]. 121 /// Log the given [msg].
122 _log(String msg) { 122 _log(String msg) {
123 //TODO(pquitslund): add proper log support 123 //TODO(pquitslund): add proper log support
124 print(msg); 124 print(msg);
125 } 125 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer_experimental/lib/src/services/formatter_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698