| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 } | 74 } |
| 75 elements.LibraryElement library = | 75 elements.LibraryElement library = |
| 76 scanner.loadLibrary(uri, null, canonicalUri); | 76 scanner.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.LibraryTag 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); |
| 87 String text = ""; | 87 String text = ""; |
| 88 try { | 88 try { |
| 89 // TODO(ahe): We expect the future to be complete and call value | 89 // TODO(ahe): We expect the future to be complete and call value |
| 90 // directly. In effect, we don't support truly asynchronous API. | 90 // directly. In effect, we don't support truly asynchronous API. |
| 91 text = provider(translated).value; | 91 text = provider(translated).value; |
| 92 } catch (exception) { | 92 } catch (exception) { |
| 93 if (node !== null) { | 93 if (node !== null) { |
| 94 cancel("$exception", node: node); | 94 cancel("$exception", node: node); |
| (...skipping 57 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 |