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

Unified Diff: compiler/java/com/google/dart/compiler/ast/LibraryExport.java

Issue 10919133: Support for new 'export' directive in resolver (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweak for parsing import/export directives Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: compiler/java/com/google/dart/compiler/ast/LibraryExport.java
diff --git a/compiler/java/com/google/dart/compiler/ast/LibraryImport.java b/compiler/java/com/google/dart/compiler/ast/LibraryExport.java
similarity index 72%
copy from compiler/java/com/google/dart/compiler/ast/LibraryImport.java
copy to compiler/java/com/google/dart/compiler/ast/LibraryExport.java
index e6f32f557768403c2c508d200b7b0ed18bd334b3..ef1d6893b481752bb13cf8323ebc04f295ec8aac 100644
--- a/compiler/java/com/google/dart/compiler/ast/LibraryImport.java
+++ b/compiler/java/com/google/dart/compiler/ast/LibraryExport.java
@@ -11,36 +11,30 @@ import java.util.List;
import java.util.Set;
/**
- * Information about import - prefix and {@link LibraryUnit}.
+ * Information about export - {@link LibraryUnit} and show/hide names.
*/
-public class LibraryImport {
+public class LibraryExport {
private final LibraryUnit library;
- private final String prefix;
private final Set<String> showNames;
private final Set<String> hideNames;
- private final boolean exported;
- public LibraryImport(LibraryUnit library, String prefix, List<ImportCombinator> combinators,
- boolean exported) {
+ public LibraryExport(LibraryUnit library, List<ImportCombinator> combinators) {
this.library = library;
- this.prefix = prefix;
this.showNames = createCombinatorsSet(combinators, true);
this.hideNames = createCombinatorsSet(combinators, false);
- this.exported = exported;
}
@Override
public int hashCode() {
- return Objects.hashCode(prefix, library);
+ return Objects.hashCode(library);
}
@Override
public boolean equals(Object obj) {
- if (obj instanceof LibraryImport) {
- LibraryImport other = (LibraryImport) obj;
- return Objects.equal(library, other.library) && Objects.equal(prefix, other.prefix)
- && Objects.equal(showNames, other.showNames) && Objects.equal(hideNames, other.hideNames)
- && exported == other.exported;
+ if (obj instanceof LibraryExport) {
+ LibraryExport other = (LibraryExport) obj;
+ return Objects.equal(library, other.library) && Objects.equal(showNames, other.showNames)
+ && Objects.equal(hideNames, other.hideNames);
}
return false;
}
@@ -49,10 +43,6 @@ public class LibraryImport {
return library;
}
- public String getPrefix() {
- return prefix;
- }
-
public boolean isVisible(String name) {
if (hideNames.contains(name)) {
return false;
@@ -63,10 +53,6 @@ public class LibraryImport {
return true;
}
- public boolean isExported() {
- return exported;
- }
-
private static Set<String> createCombinatorsSet(List<ImportCombinator> combinators, boolean show) {
Set<String> result = Sets.newHashSet();
for (ImportCombinator combinator : combinators) {

Powered by Google App Engine
This is Rietveld 408576698