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

Unified Diff: compiler/java/com/google/dart/compiler/DartCompiler.java

Issue 10827453: Stop reporting an error in parts that contain a part of directive (Closed) Base URL: http://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
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/DartCompilerErrorCode.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/DartCompiler.java
===================================================================
--- compiler/java/com/google/dart/compiler/DartCompiler.java (revision 11088)
+++ compiler/java/com/google/dart/compiler/DartCompiler.java (working copy)
@@ -16,6 +16,7 @@
import com.google.dart.compiler.ast.DartDirective;
import com.google.dart.compiler.ast.DartLibraryDirective;
import com.google.dart.compiler.ast.DartNode;
+import com.google.dart.compiler.ast.DartPartOfDirective;
import com.google.dart.compiler.ast.DartToSourceVisitor;
import com.google.dart.compiler.ast.DartUnit;
import com.google.dart.compiler.ast.LibraryNode;
@@ -697,7 +698,7 @@
// don't need to check a unit that hasn't changed
continue;
}
- if (unit.getDirectives().size() > 0) {
+ if (invalidDirectivesForPart(unit.getDirectives())) {
// find corresponding source node for this unit
for (LibraryNode sourceNode : lib.getSourcePaths()) {
if (sourceNode == lib.getSelfSourcePath()) {
@@ -717,6 +718,14 @@
}
}
+ private boolean invalidDirectivesForPart(List<DartDirective> directives) {
+ int size = directives.size();
+ if (size == 1) {
+ return !(directives.get(0) instanceof DartPartOfDirective);
+ }
+ return size > 0;
+ }
+
private void setEntryPoint() {
LibraryUnit lib = context.getAppLibraryUnit();
lib.setEntryNode(new LibraryNode(MAIN_ENTRY_POINT_NAME));
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/DartCompilerErrorCode.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698