Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: pkg/front_end/lib/src/fasta/builder/prefix_builder.dart

Issue 2780543002: Handle complicated imports. (Closed)
Patch Set: Fix infinite loop. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.prefix_builder; 5 library fasta.prefix_builder;
6 6
7 import 'builder.dart' show Builder, LibraryBuilder, MemberBuilder; 7 import 'builder.dart' show Builder, LibraryBuilder, MemberBuilder;
8 8
9 import '../messages.dart' show warning; 9 import '../messages.dart' show warning;
10 10
(...skipping 25 matching lines...) Expand all
36 return builder.member.isInstanceMember 36 return builder.member.isInstanceMember
37 ? internalError("Unexpected instance member in export scope") 37 ? internalError("Unexpected instance member in export scope")
38 : builder.member; 38 : builder.member;
39 } else if (builder is MemberBuilder) { 39 } else if (builder is MemberBuilder) {
40 return builder.target; 40 return builder.target;
41 } else { 41 } else {
42 return null; 42 return null;
43 } 43 }
44 } 44 }
45 45
46 Builder combineAmbiguousImport(
47 String name, Builder other, LibraryBuilder library) {
48 if (other is PrefixBuilder) {
49 /// Handles the case where the same prefix is used for different imports.
50 other.exports.forEach((String name, Builder member) {
51 Builder existing = exports[name];
52 if (existing != null) {
53 member = existing.combineAmbiguousImport(name, member, library);
54 }
55 exports[name] = member;
56 });
57 return this;
58 }
59 return super.combineAmbiguousImport(name, other, library);
60 }
61
62 @override 46 @override
63 String get fullNameForErrors => name; 47 String get fullNameForErrors => name;
64 } 48 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/builder/library_builder.dart ('k') | pkg/front_end/lib/src/fasta/dill/dill_library_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698