| 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('leg_apiimpl'); | 5 #library('leg_apiimpl'); |
| 6 | 6 |
| 7 #import('dart:uri'); | 7 #import('dart:uri'); |
| 8 | 8 |
| 9 #import('../compiler.dart', prefix: 'api'); | 9 #import('../compiler.dart', prefix: 'api'); |
| 10 #import('leg.dart', prefix: 'leg'); | 10 #import('leg.dart', prefix: 'leg'); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 return "lib/$path"; | 66 return "lib/$path"; |
| 67 } | 67 } |
| 68 | 68 |
| 69 elements.LibraryElement scanBuiltinLibrary(String path) { | 69 elements.LibraryElement scanBuiltinLibrary(String path) { |
| 70 Uri uri = libraryRoot.resolve(lookupLibraryPath(path)); | 70 Uri uri = libraryRoot.resolve(lookupLibraryPath(path)); |
| 71 Uri canonicalUri = null; | 71 Uri canonicalUri = null; |
| 72 if (!path.startsWith("_")) { | 72 if (!path.startsWith("_")) { |
| 73 canonicalUri = new Uri.fromComponents(scheme: "dart", path: path); | 73 canonicalUri = new Uri.fromComponents(scheme: "dart", path: path); |
| 74 } | 74 } |
| 75 elements.LibraryElement library = | 75 elements.LibraryElement library = |
| 76 scanner.loadLibrary(uri, null, canonicalUri); | 76 libraryLoader.loadLibrary(uri, null, canonicalUri); |
| 77 return library; | 77 return library; |
| 78 } | 78 } |
| 79 | 79 |
| 80 void log(message) { | 80 void log(message) { |
| 81 handler(null, null, null, message, api.Diagnostic.VERBOSE_INFO); | 81 handler(null, null, null, message, api.Diagnostic.VERBOSE_INFO); |
| 82 } | 82 } |
| 83 | 83 |
| 84 leg.Script readScript(Uri uri, [tree.Node node]) { | 84 leg.Script readScript(Uri uri, [tree.Node node]) { |
| 85 if (uri.scheme == 'dart') uri = translateDartUri(uri, node); | 85 if (uri.scheme == 'dart') uri = translateDartUri(uri, node); |
| 86 var translated = translateUri(uri, node); | 86 var translated = translateUri(uri, node); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 handler(translateUri(span.uri, null), span.begin, span.end, | 152 handler(translateUri(span.uri, null), span.begin, span.end, |
| 153 message, kind); | 153 message, kind); |
| 154 } | 154 } |
| 155 } | 155 } |
| 156 | 156 |
| 157 bool get isMockCompilation { | 157 bool get isMockCompilation { |
| 158 return mockableLibraryUsed | 158 return mockableLibraryUsed |
| 159 && (options.indexOf('--allow-mock-compilation') !== -1); | 159 && (options.indexOf('--allow-mock-compilation') !== -1); |
| 160 } | 160 } |
| 161 } | 161 } |
| OLD | NEW |