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

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

Issue 10827286: Fix for issue 4429 - remove #resource 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
Index: compiler/java/com/google/dart/compiler/parser/DartParser.java
===================================================================
--- compiler/java/com/google/dart/compiler/parser/DartParser.java (revision 10526)
+++ compiler/java/com/google/dart/compiler/parser/DartParser.java (working copy)
@@ -64,7 +64,6 @@
import com.google.dart.compiler.ast.DartParenthesizedExpression;
import com.google.dart.compiler.ast.DartPropertyAccess;
import com.google.dart.compiler.ast.DartRedirectConstructorInvocation;
-import com.google.dart.compiler.ast.DartResourceDirective;
import com.google.dart.compiler.ast.DartReturnBlock;
import com.google.dart.compiler.ast.DartReturnStatement;
import com.google.dart.compiler.ast.DartSourceDirective;
@@ -423,11 +422,7 @@
libUnit.addSourcePath(sourcePath);
}
while (peek(0) == Token.RESOURCE) {
- beginResourceDirective();
- DartResourceDirective resourceDirective = done(parseResourceDirective());
- LibraryNode resourcePath = new LibraryNode(resourceDirective.getResourceUri().getValue());
- resourcePath.setSourceInfo(resourceDirective.getSourceInfo());
- libUnit.addResourcePath(resourcePath);
+ parseResourceDirective();
}
while (peek(0) == Token.NATIVE) {
beginNativeDirective();
@@ -464,11 +459,10 @@
unit.getDirectives().add(done(parseSourceDirective()));
}
while (peek(0) == Token.RESOURCE) {
- beginResourceDirective();
- unit.getDirectives().add(done(parseResourceDirective()));
+ parseResourceDirective();
}
while (peek(0) == Token.NATIVE) {
- beginResourceDirective();
+ beginNativeDirective();
unit.getDirectives().add(done(parseNativeDirective()));
}
}
@@ -555,15 +549,15 @@
return new DartSourceDirective(sourceUri);
}
- private DartResourceDirective parseResourceDirective() {
+ private void parseResourceDirective() {
expect(Token.RESOURCE);
+ reportError(position(), ParserErrorCode.DEPRECATED_RESOURCE_DIRECTIVE);
expect(Token.LPAREN);
beginLiteral();
expect(Token.STRING);
DartStringLiteral resourceUri = done(DartStringLiteral.get(ctx.getTokenString()));
expectCloseParen();
expect(Token.SEMICOLON);
- return new DartResourceDirective(resourceUri);
}
private DartNativeDirective parseNativeDirective() {

Powered by Google App Engine
This is Rietveld 408576698