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

Unified Diff: compiler/java/com/google/dart/compiler/parser/DartParser.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/parser/DartParser.java
diff --git a/compiler/java/com/google/dart/compiler/parser/DartParser.java b/compiler/java/com/google/dart/compiler/parser/DartParser.java
index f1aa95d87faaf1cf2363907d6ad9ab3b8d03e8b8..4ab04444d471b5bff2418972441d7dddf9c81541 100644
--- a/compiler/java/com/google/dart/compiler/parser/DartParser.java
+++ b/compiler/java/com/google/dart/compiler/parser/DartParser.java
@@ -436,17 +436,24 @@ public class DartParser extends CompletionHooksParserBase {
DartLibraryDirective libraryDirective = parseLibraryDirective();
libUnit.setName(libraryDirective.getLibraryName());
}
- while (peekPseudoKeyword(0, IMPORT_KEYWORD)) {
- DartImportDirective importDirective = parseImportDirective();
- LibraryNode importPath;
- if (importDirective.getPrefix() != null) {
- importPath =
- new LibraryNode(importDirective);
- } else {
- importPath = new LibraryNode(importDirective.getLibraryUri().getValue());
+ while (peekPseudoKeyword(0, IMPORT_KEYWORD) || peekPseudoKeyword(0, EXPORT_KEYWORD)) {
+ if (peekPseudoKeyword(0, IMPORT_KEYWORD)) {
+ DartImportDirective importDirective = parseImportDirective();
+ LibraryNode importPath;
+ if (importDirective.getPrefix() != null) {
+ importPath = new LibraryNode(importDirective);
+ } else {
+ importPath = new LibraryNode(importDirective.getLibraryUri().getValue());
+ }
+ importPath.setSourceInfo(importDirective.getSourceInfo());
+ libUnit.addImportPath(importPath);
+ }
+ if (peekPseudoKeyword(0, EXPORT_KEYWORD)) {
+ DartExportDirective exportDirective = parseExportDirective();
+ LibraryNode importPath = new LibraryNode(exportDirective);
+ importPath.setSourceInfo(exportDirective.getSourceInfo());
+ libUnit.addExportPath(importPath);
}
- importPath.setSourceInfo(importDirective.getSourceInfo());
- libUnit.addImportPath(importPath);
}
while (peekPseudoKeyword(0, PART_KEYWORD)) {
if (peekPseudoKeyword(1, OF_KEYWORD)) {

Powered by Google App Engine
This is Rietveld 408576698