OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 library fasta.export; |
| 6 |
| 7 import 'builder/builder.dart' show |
| 8 Builder, |
| 9 LibraryBuilder; |
| 10 |
| 11 import 'combinator.dart' show |
| 12 Combinator; |
| 13 |
| 14 class Export { |
| 15 /// The library that is exporting [exported]; |
| 16 final LibraryBuilder exporter; |
| 17 |
| 18 /// The library being exported. |
| 19 final LibraryBuilder exported; |
| 20 |
| 21 final List<Combinator> combinators; |
| 22 |
| 23 Export(this.exporter, this.exported, this.combinators); |
| 24 |
| 25 bool addToExportScope(String name, Builder member) { |
| 26 if (combinators != null) { |
| 27 for (Combinator combinator in combinators) { |
| 28 if (combinator.isShow && !combinator.names.contains(name)) return false; |
| 29 if (combinator.isHide && combinator.names.contains(name)) return false; |
| 30 } |
| 31 } |
| 32 return exporter.addToExportScope(name, member); |
| 33 } |
| 34 } |
OLD | NEW |