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

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

Issue 10832321: Issue 4048. Support for revised library/import syntax (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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/LibraryNode.java
diff --git a/compiler/java/com/google/dart/compiler/ast/LibraryNode.java b/compiler/java/com/google/dart/compiler/ast/LibraryNode.java
index 41227cf56545f483b6938fb402c7aab9b36f8841..683b725052d9f6d94461383a7e3632e648b15126 100644
--- a/compiler/java/com/google/dart/compiler/ast/LibraryNode.java
+++ b/compiler/java/com/google/dart/compiler/ast/LibraryNode.java
@@ -4,8 +4,11 @@
package com.google.dart.compiler.ast;
+import com.google.common.collect.ImmutableList;
import com.google.dart.compiler.common.AbstractNode;
+import java.util.List;
+
/**
* An element in a library.
*/
@@ -13,6 +16,8 @@ public class LibraryNode extends AbstractNode {
private final String text;
private final String prefix;
+ private final List<ImportCombinator> combinators;
+ private final boolean exported;
/**
* Construct a new library node instance
@@ -21,12 +26,17 @@ public class LibraryNode extends AbstractNode {
* @param text the text comprising the node (not <code>null</code>)
*/
public LibraryNode(String text) {
- this(text, null);
+ this.text = text;
+ this.prefix = null;
+ this.combinators = ImmutableList.<ImportCombinator>of();
+ this.exported = false;
}
- public LibraryNode(String text, String prefix) {
- this.text = text;
- this.prefix = prefix;
+ public LibraryNode(DartImportDirective importDirective) {
+ this.text = importDirective.getLibraryUri().getValue();
+ this.prefix = importDirective.getPrefixValue();
+ this.combinators = importDirective.getCombinators();
+ this.exported = importDirective.isExported();
}
public String getText() {
@@ -36,4 +46,12 @@ public class LibraryNode extends AbstractNode {
public String getPrefix() {
return prefix;
}
+
+ public List<ImportCombinator> getCombinators() {
+ return combinators;
+ }
+
+ public boolean isExported() {
+ return exported;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698