| 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 class ScannerTask extends CompilerTask { | 5 class ScannerTask extends CompilerTask { |
| 6 ScannerTask(Compiler compiler) : super(compiler); | 6 ScannerTask(Compiler compiler) : super(compiler); |
| 7 String get name() => 'Scanner'; | 7 String get name() => 'Scanner'; |
| 8 | 8 |
| 9 void scan(CompilationUnitElement compilationUnit) { | 9 void scan(CompilationUnitElement compilationUnit) { |
| 10 measure(() { | 10 measure(() { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 compiler.dietParser.dietParse(compilationUnit, tokens); | 85 compiler.dietParser.dietParse(compilationUnit, tokens); |
| 86 } | 86 } |
| 87 | 87 |
| 88 LibraryElement loadLibrary(Uri uri, ScriptTag node) { | 88 LibraryElement loadLibrary(Uri uri, ScriptTag node) { |
| 89 bool newLibrary = false; | 89 bool newLibrary = false; |
| 90 LibraryElement library = | 90 LibraryElement library = |
| 91 compiler.universe.libraries.putIfAbsent(uri.toString(), () { | 91 compiler.universe.libraries.putIfAbsent(uri.toString(), () { |
| 92 newLibrary = true; | 92 newLibrary = true; |
| 93 Script script = compiler.readScript(uri, node); | 93 Script script = compiler.readScript(uri, node); |
| 94 LibraryElement element = new LibraryElement(script); | 94 LibraryElement element = new LibraryElement(script); |
| 95 native.checkNativeSupport(compiler, element); | 95 native.checkNativeSupport(compiler, element, uri); |
| 96 return element; | 96 return element; |
| 97 }); | 97 }); |
| 98 if (newLibrary) { | 98 if (newLibrary) { |
| 99 compiler.withCurrentElement(library, () => scan(library)); | 99 compiler.withCurrentElement(library, () => scan(library)); |
| 100 } | 100 } |
| 101 return library; | 101 return library; |
| 102 } | 102 } |
| 103 | 103 |
| 104 void importLibrary(LibraryElement library, LibraryElement imported, | 104 void importLibrary(LibraryElement library, LibraryElement imported, |
| 105 LiteralString prefix) { | 105 LiteralString prefix) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 121 final String name = 'Diet Parser'; | 121 final String name = 'Diet Parser'; |
| 122 | 122 |
| 123 dietParse(CompilationUnitElement compilationUnit, Token tokens) { | 123 dietParse(CompilationUnitElement compilationUnit, Token tokens) { |
| 124 measure(() { | 124 measure(() { |
| 125 ElementListener listener = new ElementListener(compiler, compilationUnit); | 125 ElementListener listener = new ElementListener(compiler, compilationUnit); |
| 126 PartialParser parser = new PartialParser(listener); | 126 PartialParser parser = new PartialParser(listener); |
| 127 parser.parseUnit(tokens); | 127 parser.parseUnit(tokens); |
| 128 }); | 128 }); |
| 129 } | 129 } |
| 130 } | 130 } |
| OLD | NEW |