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

Unified Diff: lib/compiler/implementation/tree/nodes.dart

Issue 10990060: Added support for exports and re-exports. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments Created 8 years, 2 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: lib/compiler/implementation/tree/nodes.dart
diff --git a/lib/compiler/implementation/tree/nodes.dart b/lib/compiler/implementation/tree/nodes.dart
index 72467acf9edb737f639d35ab13a9a95ef5871f0a..da480f7436e46134a20f1c26627f700337087604 100644
--- a/lib/compiler/implementation/tree/nodes.dart
+++ b/lib/compiler/implementation/tree/nodes.dart
@@ -1682,14 +1682,32 @@ class LibraryName extends LibraryTag {
Token getEndToken() => name.getEndToken().next;
}
-class Import extends LibraryTag {
+/**
+ * This tag describes a dependency between one library and the exported
+ * identifiers of another library. The other library is specified by the [uri].
+ * Combinators filter away some identifiers from the other library.
+ */
+abstract class LibraryDependency extends LibraryTag {
final LiteralString uri;
- final Identifier prefix;
final NodeList combinators;
+ LibraryDependency(this.uri, this.combinators);
+}
+
+/**
+ * An [:import:] library tag.
+ *
+ * An import tag is dependency on another library where the exported identifiers
+ * are put into the import scope of the importing library. The import scope is
+ * only visible inside the library.
+ */
+class Import extends LibraryDependency {
+ final Identifier prefix;
final Token importKeyword;
- Import(this.importKeyword, this.uri, this.prefix, this.combinators);
+ Import(this.importKeyword, LiteralString uri,
+ this.prefix, NodeList combinators)
+ : super(uri, combinators);
bool get isImport => true;
@@ -1714,13 +1732,18 @@ class Import extends LibraryTag {
}
}
-class Export extends LibraryTag {
- final LiteralString uri;
- final NodeList combinators;
-
+/**
+ * An [:export:] library tag.
+ *
+ * An export tag is dependency on another library where the exported identifiers
+ * are put into the export scope of the exporting library. The export scope is
+ * not visible inside the library.
+ */
+class Export extends LibraryDependency {
final Token exportKeyword;
- Export(this.exportKeyword, this.uri, this.combinators);
+ Export(this.exportKeyword, LiteralString uri, NodeList combinators)
+ : super(uri, combinators);
bool get isExport => true;

Powered by Google App Engine
This is Rietveld 408576698