OLD | NEW |
1 #!/usr/bin/env dart | 1 #!/usr/bin/env dart |
2 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 2 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
3 // for details. All rights reserved. Use of this source code is governed by a | 3 // for details. All rights reserved. Use of this source code is governed by a |
4 // BSD-style license that can be found in the LICENSE file. | 4 // BSD-style license that can be found in the LICENSE file. |
5 | 5 |
6 /// Command line tool to merge the SDK libraries and our patch files. | 6 /// Command line tool to merge the SDK libraries and our patch files. |
7 /// This is currently designed as an offline tool, but we could automate it. | 7 /// This is currently designed as an offline tool, but we could automate it. |
8 library dev_compiler.tool.patch_sdk; | |
9 | 8 |
10 import 'dart:io'; | 9 import 'dart:io'; |
11 import 'dart:math' as math; | 10 import 'dart:math' as math; |
12 | 11 |
13 import 'package:analyzer/analyzer.dart'; | 12 import 'package:analyzer/analyzer.dart'; |
14 import 'package:analyzer/src/generated/sdk.dart'; | 13 import 'package:analyzer/src/generated/sdk.dart'; |
15 import 'package:path/path.dart' as path; | 14 import 'package:path/path.dart' as path; |
16 | 15 |
17 void main(List<String> argv) { | 16 void main(List<String> argv) { |
18 if (argv.length < 2) { | 17 if (argv.length < 2) { |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 if (diff != 0) return diff; | 431 if (diff != 0) return diff; |
433 return end - other.end; | 432 return end - other.end; |
434 } | 433 } |
435 } | 434 } |
436 | 435 |
437 List<SdkLibrary> _getSdkLibraries(String contents) { | 436 List<SdkLibrary> _getSdkLibraries(String contents) { |
438 var libraryBuilder = new SdkLibrariesReader_LibraryBuilder(true); | 437 var libraryBuilder = new SdkLibrariesReader_LibraryBuilder(true); |
439 parseCompilationUnit(contents).accept(libraryBuilder); | 438 parseCompilationUnit(contents).accept(libraryBuilder); |
440 return libraryBuilder.librariesMap.sdkLibraries; | 439 return libraryBuilder.librariesMap.sdkLibraries; |
441 } | 440 } |
OLD | NEW |