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.dill_library_builder; | 5 library fasta.dill_library_builder; |
6 | 6 |
7 import 'package:kernel/ast.dart' | 7 import 'package:kernel/ast.dart' |
8 show Class, Field, Library, ListLiteral, Member, StaticGet, Typedef; | 8 show Class, Field, Library, ListLiteral, Member, StaticGet, Typedef; |
9 | 9 |
10 import '../errors.dart' show internalError; | 10 import '../deprecated_problems.dart' show deprecated_internalProblem; |
11 | 11 |
12 import '../kernel/kernel_builder.dart' | 12 import '../kernel/kernel_builder.dart' |
13 show | 13 show |
14 Builder, | 14 Builder, |
15 InvalidTypeBuilder, | 15 InvalidTypeBuilder, |
16 KernelInvalidTypeBuilder, | 16 KernelInvalidTypeBuilder, |
17 KernelTypeBuilder, | 17 KernelTypeBuilder, |
18 LibraryBuilder, | 18 LibraryBuilder, |
19 Scope; | 19 Scope; |
20 | 20 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 return builder; | 87 return builder; |
88 } | 88 } |
89 | 89 |
90 void addTypedef(Typedef typedef) { | 90 void addTypedef(Typedef typedef) { |
91 var typedefBuilder = new DillFunctionTypeAliasBuilder(typedef, this); | 91 var typedefBuilder = new DillFunctionTypeAliasBuilder(typedef, this); |
92 addBuilder(typedef.name, typedefBuilder, typedef.fileOffset); | 92 addBuilder(typedef.name, typedefBuilder, typedef.fileOffset); |
93 } | 93 } |
94 | 94 |
95 @override | 95 @override |
96 void addToScope(String name, Builder member, int charOffset, bool isImport) { | 96 void addToScope(String name, Builder member, int charOffset, bool isImport) { |
97 internalError("Not implemented yet."); | 97 deprecated_internalProblem("Not implemented yet."); |
98 } | 98 } |
99 | 99 |
100 @override | 100 @override |
101 Builder buildAmbiguousBuilder( | 101 Builder buildAmbiguousBuilder( |
102 String name, Builder builder, Builder other, int charOffset, | 102 String name, Builder builder, Builder other, int charOffset, |
103 {bool isExport: false, bool isImport: false}) { | 103 {bool isExport: false, bool isImport: false}) { |
104 if (builder == other) return builder; | 104 if (builder == other) return builder; |
105 if (builder is InvalidTypeBuilder) return builder; | 105 if (builder is InvalidTypeBuilder) return builder; |
106 if (other is InvalidTypeBuilder) return other; | 106 if (other is InvalidTypeBuilder) return other; |
107 // For each entry mapping key `k` to declaration `d` in `NS` an entry | 107 // For each entry mapping key `k` to declaration `d` in `NS` an entry |
108 // mapping `k` to `d` is added to the exported namespace of `L` unless a | 108 // mapping `k` to `d` is added to the exported namespace of `L` unless a |
109 // top-level declaration with the name `k` exists in `L`. | 109 // top-level declaration with the name `k` exists in `L`. |
110 if (builder.parent == this) return builder; | 110 if (builder.parent == this) return builder; |
111 return new KernelInvalidTypeBuilder(name, charOffset, fileUri); | 111 return new KernelInvalidTypeBuilder(name, charOffset, fileUri); |
112 } | 112 } |
113 | 113 |
114 @override | 114 @override |
115 String get fullNameForErrors { | 115 String get fullNameForErrors { |
116 return library.name ?? "<library '${library.fileUri}'>"; | 116 return library.name ?? "<library '${library.fileUri}'>"; |
117 } | 117 } |
118 } | 118 } |
OLD | NEW |