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

Unified Diff: compiler/java/com/google/dart/compiler/parser/DartParser.java

Issue 12038042: Issue 7598. Skip metadata when parse directives for LibraryUnit. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/end2end/inc/IncrementalCompilation2Test.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1a3e0c5b936fbd4383d4ad3bdd25d4ea4bd1fbc0..771199dc23f0900c36174c9743347f9e2f9bf716 100644
--- a/compiler/java/com/google/dart/compiler/parser/DartParser.java
+++ b/compiler/java/com/google/dart/compiler/parser/DartParser.java
@@ -469,9 +469,11 @@ public class DartParser extends CompletionHooksParserBase {
public LibraryUnit preProcessLibraryDirectives(LibrarySource source) {
beginCompilationUnit();
LibraryUnit libUnit = new LibraryUnit(source);
+ parseMetadata();
if (peekPseudoKeyword(0, LIBRARY_KEYWORD)) {
DartLibraryDirective libraryDirective = parseLibraryDirective();
libUnit.setName(libraryDirective.getLibraryName());
+ parseMetadata();
}
while (peekPseudoKeyword(0, IMPORT_KEYWORD) || peekPseudoKeyword(0, EXPORT_KEYWORD)) {
if (peekPseudoKeyword(0, IMPORT_KEYWORD)) {
@@ -486,6 +488,7 @@ public class DartParser extends CompletionHooksParserBase {
importPath.setSourceInfo(exportDirective.getSourceInfo());
libUnit.addExportPath(importPath);
}
+ parseMetadata();
}
while (peekPseudoKeyword(0, PART_KEYWORD)) {
if (peekPseudoKeyword(1, OF_KEYWORD)) {
@@ -496,6 +499,7 @@ public class DartParser extends CompletionHooksParserBase {
sourcePath.setSourceInfo(sourceDirective.getSourceInfo());
libUnit.addSourcePath(sourcePath);
}
+ parseMetadata();
}
//
// The code below is obsolete. We do not make any effort to find duplications between the old
@@ -505,6 +509,7 @@ public class DartParser extends CompletionHooksParserBase {
beginLibraryDirective();
DartLibraryDirective libDirective = done(parseObsoleteLibraryDirective());
libUnit.setName(libDirective.getLibraryName());
+ parseMetadata();
}
while (peek(0) == Token.IMPORT) {
beginImportDirective();
@@ -518,6 +523,7 @@ public class DartParser extends CompletionHooksParserBase {
}
importPath.setSourceInfo(importDirective.getSourceInfo());
libUnit.addImportPath(importPath);
+ parseMetadata();
}
while (peek(0) == Token.SOURCE) {
beginSourceDirective();
@@ -525,9 +531,11 @@ public class DartParser extends CompletionHooksParserBase {
LibraryNode sourcePath = new LibraryNode(sourceDirective.getSourceUri().getValue());
sourcePath.setSourceInfo(sourceDirective.getSourceInfo());
libUnit.addSourcePath(sourcePath);
+ parseMetadata();
}
while (peek(0) == Token.RESOURCE) {
parseResourceDirective();
+ parseMetadata();
}
while (peek(0) == Token.NATIVE) {
beginNativeDirective();
@@ -535,6 +543,7 @@ public class DartParser extends CompletionHooksParserBase {
LibraryNode nativePath = new LibraryNode(nativeDirective.getNativeUri().getValue());
nativePath.setSourceInfo(nativeDirective.getSourceInfo());
libUnit.addNativePath(nativePath);
+ parseMetadata();
}
// add ourselves to the list of sources, so inline dart code will be parsed
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/end2end/inc/IncrementalCompilation2Test.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698