| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 dart2js.scanner.task; | 5 library dart2js.scanner.task; |
| 6 | 6 |
| 7 import '../common/tasks.dart' show | 7 import '../common/tasks.dart' show |
| 8 CompilerTask; | 8 CompilerTask; |
| 9 import '../compiler.dart' show | 9 import '../compiler.dart' show |
| 10 Compiler; | 10 Compiler; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 class ScannerTask extends CompilerTask { | 24 class ScannerTask extends CompilerTask { |
| 25 ScannerTask(Compiler compiler) : super(compiler); | 25 ScannerTask(Compiler compiler) : super(compiler); |
| 26 String get name => 'Scanner'; | 26 String get name => 'Scanner'; |
| 27 | 27 |
| 28 void scanLibrary(LibraryElement library) { | 28 void scanLibrary(LibraryElement library) { |
| 29 CompilationUnitElement compilationUnit = library.entryCompilationUnit; | 29 CompilationUnitElement compilationUnit = library.entryCompilationUnit; |
| 30 String canonicalUri = library.canonicalUri.toString(); | 30 String canonicalUri = library.canonicalUri.toString(); |
| 31 String resolvedUri = compilationUnit.script.resourceUri.toString(); | 31 String resolvedUri = compilationUnit.script.resourceUri.toString(); |
| 32 if (canonicalUri == resolvedUri) { | 32 if (canonicalUri == resolvedUri) { |
| 33 compiler.log("Scanning library $canonicalUri"); | 33 reporter.log("Scanning library $canonicalUri"); |
| 34 } else { | 34 } else { |
| 35 compiler.log("Scanning library $canonicalUri ($resolvedUri)"); | 35 reporter.log("Scanning library $canonicalUri ($resolvedUri)"); |
| 36 } | 36 } |
| 37 scan(compilationUnit); | 37 scan(compilationUnit); |
| 38 } | 38 } |
| 39 | 39 |
| 40 void scan(CompilationUnitElement compilationUnit) { | 40 void scan(CompilationUnitElement compilationUnit) { |
| 41 measure(() { | 41 measure(() { |
| 42 scanElements(compilationUnit); | 42 scanElements(compilationUnit); |
| 43 }); | 43 }); |
| 44 } | 44 } |
| 45 | 45 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 60 * value ('\x00'). If [source] does not end with '0', the string is copied | 60 * value ('\x00'). If [source] does not end with '0', the string is copied |
| 61 * before scanning. | 61 * before scanning. |
| 62 */ | 62 */ |
| 63 Token tokenize(String source) { | 63 Token tokenize(String source) { |
| 64 return measure(() { | 64 return measure(() { |
| 65 return new StringScanner.fromString(source, includeComments: false) | 65 return new StringScanner.fromString(source, includeComments: false) |
| 66 .tokenize(); | 66 .tokenize(); |
| 67 }); | 67 }); |
| 68 } | 68 } |
| 69 } | 69 } |
| OLD | NEW |