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 part of scanner; | 5 part of scanner; |
6 | 6 |
7 class ScannerTask extends CompilerTask { | 7 class ScannerTask extends CompilerTask { |
8 ScannerTask(Compiler compiler) : super(compiler); | 8 ScannerTask(Compiler compiler) : super(compiler); |
9 String get name => 'Scanner'; | 9 String get name => 'Scanner'; |
10 | 10 |
11 void scanLibrary(LibraryElement library) { | 11 void scanLibrary(LibraryElement library) { |
12 var compilationUnit = library.entryCompilationUnit; | 12 var compilationUnit = library.entryCompilationUnit; |
13 compiler.log("scanning library ${compilationUnit.script.name}"); | 13 var canonicalUri = library.uri.toString(); |
| 14 var resolvedUri = compilationUnit.script.uri.toString(); |
| 15 if (canonicalUri == resolvedUri) { |
| 16 compiler.log("scanning library $canonicalUri"); |
| 17 } else { |
| 18 compiler.log("scanning library $canonicalUri ($resolvedUri)"); |
| 19 } |
14 scan(compilationUnit); | 20 scan(compilationUnit); |
15 } | 21 } |
16 | 22 |
17 void scan(CompilationUnitElement compilationUnit) { | 23 void scan(CompilationUnitElement compilationUnit) { |
18 measure(() { | 24 measure(() { |
19 scanElements(compilationUnit); | 25 scanElements(compilationUnit); |
20 }); | 26 }); |
21 } | 27 } |
22 | 28 |
23 void scanElements(CompilationUnitElement compilationUnit) { | 29 void scanElements(CompilationUnitElement compilationUnit) { |
(...skipping 10 matching lines...) Expand all Loading... |
34 dietParse(CompilationUnitElement compilationUnit, Token tokens) { | 40 dietParse(CompilationUnitElement compilationUnit, Token tokens) { |
35 measure(() { | 41 measure(() { |
36 Function idGenerator = compiler.getNextFreeClassId; | 42 Function idGenerator = compiler.getNextFreeClassId; |
37 ElementListener listener = | 43 ElementListener listener = |
38 new ElementListener(compiler, compilationUnit, idGenerator); | 44 new ElementListener(compiler, compilationUnit, idGenerator); |
39 PartialParser parser = new PartialParser(listener); | 45 PartialParser parser = new PartialParser(listener); |
40 parser.parseUnit(tokens); | 46 parser.parseUnit(tokens); |
41 }); | 47 }); |
42 } | 48 } |
43 } | 49 } |
OLD | NEW |