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.import; | 5 library fasta.import; |
6 | 6 |
7 import 'builder/builder.dart' show Builder, LibraryBuilder, PrefixBuilder; | 7 import 'builder/builder.dart' show Builder, LibraryBuilder, PrefixBuilder; |
8 | 8 |
9 import 'combinator.dart' show Combinator; | 9 import 'combinator.dart' show Combinator; |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 PrefixBuilder prefix; | 37 PrefixBuilder prefix; |
38 if (this.prefix == null) { | 38 if (this.prefix == null) { |
39 add = (String name, Builder member) { | 39 add = (String name, Builder member) { |
40 importer.addToScope(name, member, charOffset, true); | 40 importer.addToScope(name, member, charOffset, true); |
41 }; | 41 }; |
42 } else { | 42 } else { |
43 prefix = | 43 prefix = |
44 new PrefixBuilder(this.prefix, deferred, importer, prefixCharOffset); | 44 new PrefixBuilder(this.prefix, deferred, importer, prefixCharOffset); |
45 add = (String name, Builder member) { | 45 add = (String name, Builder member) { |
46 if (member.isSetter) { | 46 if (member.isSetter) { |
47 prefix.exports.setters[name] = member; | 47 prefix.exportScope.setters[name] = member; |
48 } else { | 48 } else { |
49 prefix.exports.local[name] = member; | 49 prefix.exportScope.local[name] = member; |
50 } | 50 } |
51 }; | 51 }; |
52 } | 52 } |
53 imported.exports.forEach((String name, Builder member) { | 53 imported.exportScope.forEach((String name, Builder member) { |
54 if (combinators != null) { | 54 if (combinators != null) { |
55 for (Combinator combinator in combinators) { | 55 for (Combinator combinator in combinators) { |
56 if (combinator.isShow && !combinator.names.contains(name)) return; | 56 if (combinator.isShow && !combinator.names.contains(name)) return; |
57 if (combinator.isHide && combinator.names.contains(name)) return; | 57 if (combinator.isHide && combinator.names.contains(name)) return; |
58 } | 58 } |
59 } | 59 } |
60 add(name, member); | 60 add(name, member); |
61 }); | 61 }); |
62 if (prefix != null) { | 62 if (prefix != null) { |
63 Builder existing = importer.addBuilder(prefix.name, prefix, charOffset); | 63 Builder existing = importer.addBuilder(prefix.name, prefix, charOffset); |
64 if (existing == prefix) { | 64 if (existing == prefix) { |
65 importer.addToScope(prefix.name, prefix, prefixCharOffset, true); | 65 importer.addToScope(prefix.name, prefix, prefixCharOffset, true); |
66 } | 66 } |
67 } | 67 } |
68 } | 68 } |
69 } | 69 } |
OLD | NEW |