| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 bool run(Uri uri) { | 89 bool run(Uri uri) { |
| 90 bool success = super.run(uri); | 90 bool success = super.run(uri); |
| 91 for (final task in tasks) { | 91 for (final task in tasks) { |
| 92 log('${task.name} took ${task.timing}msec'); | 92 log('${task.name} took ${task.timing}msec'); |
| 93 } | 93 } |
| 94 return success; | 94 return success; |
| 95 } | 95 } |
| 96 | 96 |
| 97 void reportDiagnostic(leg.SourceSpan span, String message, | 97 void reportDiagnostic(leg.SourceSpan span, String message, |
| 98 api.Diagnostic kind) { | 98 api.Diagnostic kind) { |
| 99 if (kind === api.Diagnostic.ERROR || kind === api.Diagnostic.CRASH) { | |
| 100 compilationFailed = true; | |
| 101 } | |
| 102 if (span === null) { | 99 if (span === null) { |
| 103 handler(null, null, null, message, kind); | 100 handler(null, null, null, message, kind); |
| 104 } else { | 101 } else { |
| 105 handler(translateUri(span.uri, null), span.begin, span.end, | 102 handler(translateUri(span.uri, null), span.begin, span.end, |
| 106 message, kind); | 103 message, kind); |
| 107 } | 104 } |
| 108 } | 105 } |
| 109 | 106 |
| 110 bool get isMockCompilation() { | 107 bool get isMockCompilation() { |
| 111 return mockableLibraryUsed | 108 return mockableLibraryUsed |
| 112 && (options.indexOf('--allow-mock-compilation') !== -1); | 109 && (options.indexOf('--allow-mock-compilation') !== -1); |
| 113 } | 110 } |
| 114 } | 111 } |
| OLD | NEW |