Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmanuel Graf2011-03-07 02:26:26 -0500
committerEmanuel Graf2011-03-07 02:26:26 -0500
commit654e12094a5b0b77e8877550922343dc5def49c9 (patch)
tree84adebc25b342e27628c8ee9460f03dfe917e3c2 /core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite
parentc2b14277a39ee7364881508795d12abcc1bbeb9e (diff)
downloadorg.eclipse.cdt-654e12094a5b0b77e8877550922343dc5def49c9.tar.gz
org.eclipse.cdt-654e12094a5b0b77e8877550922343dc5def49c9.tar.xz
org.eclipse.cdt-654e12094a5b0b77e8877550922343dc5def49c9.zip
Bug 337937: CopyLocation for copied AST-Node
https://bugs.eclipse.org/bugs/show_bug.cgi?id=337937
Diffstat (limited to 'core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/ASTLiteralNode.java6
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ContainerNode.java15
2 files changed, 16 insertions, 5 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/ASTLiteralNode.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/ASTLiteralNode.java
index 8da53a7b73..638108f78a 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/ASTLiteralNode.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/ASTLiteralNode.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007, 2011 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -104,6 +104,10 @@ public class ASTLiteralNode implements IASTNode {
throw new UnsupportedOperationException();
}
+ public IASTNode copy(CopyStyle style) {
+ throw new UnsupportedOperationException();
+ }
+
public boolean isActive() {
return true;
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ContainerNode.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ContainerNode.java
index 39f2dd0a95..a9cfdeee41 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ContainerNode.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/astwriter/ContainerNode.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Institute for Software, HSR Hochschule fuer Technik
+ * Copyright (c) 2008, 2011 Institute for Software, HSR Hochschule fuer Technik
* Rapperswil, University of applied sciences and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -43,13 +43,20 @@ public class ContainerNode extends ASTNode {
}
public ContainerNode copy() {
+ return copy(CopyStyle.withoutLocations);
+ }
+
+ public ContainerNode copy(CopyStyle style) {
ContainerNode copy = new ContainerNode();
- for(IASTNode node : getNodes())
- copy.addNode(node == null ? null : node.copy());
+ for (IASTNode node : getNodes())
+ copy.addNode(node == null ? null : node.copy(style));
copy.setOffsetAndLength(this);
+ if (style == CopyStyle.withLocations) {
+ copy.setCopyLocation(this);
+ }
return copy;
}
-
+
public void addNode(IASTNode node) {
nodes.add(node);
if(node.getParent() == null) {

Back to the top