OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 fasta.library_builder; | 5 library fasta.library_builder; |
6 | 6 |
7 import '../combinator.dart' show Combinator; | 7 import '../combinator.dart' show Combinator; |
8 | 8 |
9 import '../errors.dart' show InputError, internalError, printUnexpected; | 9 import '../errors.dart' show InputError, internalError, printUnexpected; |
10 | 10 |
11 import '../export.dart' show Export; | 11 import '../export.dart' show Export; |
12 | 12 |
13 import '../loader.dart' show Loader; | 13 import '../loader.dart' show Loader; |
14 | 14 |
15 import '../messages.dart' show nit, warning; | 15 import '../messages.dart' show nit, warning; |
16 | 16 |
17 import '../util/relativize.dart' show relativizeUri; | 17 import '../util/relativize.dart' show relativizeUri; |
18 | 18 |
19 import 'builder.dart' show Builder, ClassBuilder, TypeBuilder; | 19 import 'builder.dart' |
| 20 show |
| 21 Builder, |
| 22 DynamicTypeBuilder, |
| 23 ClassBuilder, |
| 24 TypeBuilder, |
| 25 VoidTypeBuilder; |
20 | 26 |
21 import 'scope.dart' show Scope; | 27 import 'scope.dart' show Scope; |
22 | 28 |
23 abstract class LibraryBuilder<T extends TypeBuilder, R> extends Builder { | 29 abstract class LibraryBuilder<T extends TypeBuilder, R> extends Builder { |
24 final List<Export> exporters = <Export>[]; | 30 final List<Export> exporters = <Export>[]; |
25 | 31 |
26 final List<InputError> compileTimeErrors = <InputError>[]; | 32 final List<InputError> compileTimeErrors = <InputError>[]; |
27 | 33 |
28 LibraryBuilder partOfLibrary; | 34 LibraryBuilder partOfLibrary; |
29 | 35 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 } | 117 } |
112 } else if (constructor.isFactory) { | 118 } else if (constructor.isFactory) { |
113 return constructor; | 119 return constructor; |
114 } | 120 } |
115 } | 121 } |
116 throw internalError("Internal error: No constructor named" | 122 throw internalError("Internal error: No constructor named" |
117 " '$className::$constructorName' in '$uri'."); | 123 " '$className::$constructorName' in '$uri'."); |
118 } | 124 } |
119 | 125 |
120 int finishTypeVariables(ClassBuilder object) => 0; | 126 int finishTypeVariables(ClassBuilder object) => 0; |
| 127 |
| 128 void becomeCoreLibrary(dynamicType, voidType) { |
| 129 addBuilder("dynamic", |
| 130 new DynamicTypeBuilder<T, dynamic>(dynamicType, this, -1), -1); |
| 131 addBuilder("void", new VoidTypeBuilder<T, dynamic>(voidType, this, -1), -1); |
| 132 } |
121 } | 133 } |
OLD | NEW |