blob: 2f5e5909d6c72cdd1a0eb0733c65c60df1f009e5 [file] [log] [blame]
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:analyzer/src/summary2/combinator.dart';
import 'package:analyzer/src/summary2/library_builder.dart';
import 'package:analyzer/src/summary2/reference.dart';
class Export {
final LibraryBuilder exporter;
final LibraryBuilder? exported;
final List<Combinator> combinators;
Export(this.exporter, this.exported, this.combinators);
bool addToExportScope(String name, Reference reference) {
for (Combinator combinator in combinators) {
if (combinator.isShow && !combinator.matches(name)) return false;
if (combinator.isHide && combinator.matches(name)) return false;
}
return exporter.addToExportScope(name, reference);
}
}