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

Unified Diff: editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/processor/SemanticProcessor.java

Issue 184893003: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/processor/SemanticProcessor.java
diff --git a/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/processor/SemanticProcessor.java b/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/processor/SemanticProcessor.java
index ff7d9fba7067232fc537aede95e2ead73c61a97c..390be7d55065ca746fb09d3964723dd5485d74e1 100644
--- a/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/processor/SemanticProcessor.java
+++ b/editor/util/plugins/com.google.dart.java2dart/src/com/google/dart/java2dart/processor/SemanticProcessor.java
@@ -16,6 +16,8 @@ package com.google.dart.java2dart.processor;
import com.google.common.base.Objects;
import com.google.dart.engine.ast.ASTNode;
+import com.google.dart.engine.ast.Block;
+import com.google.dart.engine.ast.ClassDeclaration;
import com.google.dart.engine.ast.CompilationUnit;
import com.google.dart.engine.ast.MethodInvocation;
import com.google.dart.java2dart.Context;
@@ -41,6 +43,19 @@ public abstract class SemanticProcessor {
return (E) node;
}
+ public static void removeNode(ASTNode node) {
+ ASTNode parent = node.getParent();
+ if (parent instanceof Block) {
+ ((Block) parent).getStatements().remove(node);
+ return;
+ }
+ if (parent instanceof ClassDeclaration) {
+ ((ClassDeclaration) parent).getMembers().remove(node);
+ return;
+ }
+ throw new IllegalArgumentException("Unsupported parent type: " + parent.getClass());
+ }
+
/**
* Replaces "node" with "replacement" in parent of "node".
*/

Powered by Google App Engine
This is Rietveld 408576698