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 compiler; | 5 library compiler; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:uri'; | 8 import 'dart:uri'; |
9 import 'implementation/apiimpl.dart'; | 9 import 'implementation/apiimpl.dart'; |
10 | 10 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 if (code != null && outputProvider != null) { | 98 if (code != null && outputProvider != null) { |
99 String outputType = 'js'; | 99 String outputType = 'js'; |
100 if (options.contains('--output-type=dart')) { | 100 if (options.contains('--output-type=dart')) { |
101 outputType = 'dart'; | 101 outputType = 'dart'; |
102 } | 102 } |
103 outputProvider('', outputType) | 103 outputProvider('', outputType) |
104 ..add(code) | 104 ..add(code) |
105 ..close(); | 105 ..close(); |
106 code = ''; // Non-null signals success. | 106 code = ''; // Non-null signals success. |
107 } | 107 } |
108 return new Future.immediate(code); | 108 return new Future.value(code); |
109 } | 109 } |
110 | 110 |
111 /** | 111 /** |
112 * Kind of diagnostics that the compiler can report. | 112 * Kind of diagnostics that the compiler can report. |
113 */ | 113 */ |
114 class Diagnostic { | 114 class Diagnostic { |
115 /** | 115 /** |
116 * An error as identified by the "Dart Programming Language | 116 * An error as identified by the "Dart Programming Language |
117 * Specification" [http://www.dartlang.org/docs/spec/]. | 117 * Specification" [http://www.dartlang.org/docs/spec/]. |
118 * | 118 * |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 final String name; | 168 final String name; |
169 | 169 |
170 /** | 170 /** |
171 * This constructor is not private to support user-defined | 171 * This constructor is not private to support user-defined |
172 * diagnostic kinds. | 172 * diagnostic kinds. |
173 */ | 173 */ |
174 const Diagnostic(this.ordinal, this.name); | 174 const Diagnostic(this.ordinal, this.name); |
175 | 175 |
176 String toString() => name; | 176 String toString() => name; |
177 } | 177 } |
OLD | NEW |