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

Unified Diff: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/DartLibraryImpl.java

Issue 10832274: Initial parser changes for the new directive syntax (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: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/DartLibraryImpl.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/DartLibraryImpl.java (revision 10597)
+++ editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/DartLibraryImpl.java (working copy)
@@ -19,6 +19,7 @@
import com.google.dart.compiler.LibrarySource;
import com.google.dart.compiler.SystemLibraryManager;
import com.google.dart.compiler.UrlLibrarySource;
+import com.google.dart.compiler.ast.DartIdentifier;
import com.google.dart.compiler.ast.DartImportDirective;
import com.google.dart.compiler.ast.DartLibraryDirective;
import com.google.dart.compiler.ast.DartSourceDirective;
@@ -747,6 +748,7 @@
}
final DartModelManager modelManager = DartModelManager.getInstance();
unit.accept(new SafeDartNodeTraverser<Void>() {
+ @SuppressWarnings("deprecation")
@Override
public Void visitImportDirective(DartImportDirective node) {
// prepare "path"
@@ -768,8 +770,16 @@
// prepare "prefix"
String prefix = null;
SourceRange nameRange = null;
+ DartIdentifier prefixNode = node.getPrefix();
+ if (prefixNode != null) {
+ prefix = prefixNode.getName();
+ SourceInfo prefixSourceInfo = prefixNode.getSourceInfo();
+ nameRange = new SourceRangeImpl(
+ prefixSourceInfo.getOffset(),
+ prefixSourceInfo.getLength());
+ }
{
- DartStringLiteral prefixLiteral = node.getPrefix();
+ DartStringLiteral prefixLiteral = node.getOldPrefix();
if (prefixLiteral != null) {
prefix = prefixLiteral.getValue();
SourceInfo prefixSourceInfo = prefixLiteral.getSourceInfo();
@@ -862,11 +872,7 @@
@Override
public Void visitLibraryDirective(DartLibraryDirective node) {
- DartStringLiteral literal = node.getName();
- if (literal == null) {
- return null;
- }
- libraryInfo.setName(literal.getValue());
+ libraryInfo.setName(node.getLibraryName());
return null;
}

Powered by Google App Engine
This is Rietveld 408576698