mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Automatic formatting of code affected by refactoring.
This commit is contained in:
parent
65673a50e1
commit
afb3fae823
90 changed files with 5152 additions and 5765 deletions
|
@ -70,11 +70,12 @@ public class ASTWriterTest extends RewriteBaseTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void compareFiles(Map<String,TestSourceFile> testResourceFiles) throws Exception {
|
protected void compareFiles(Map<String, TestSourceFile> testResourceFiles) throws Exception {
|
||||||
for (String fileName : testResourceFiles.keySet()) {
|
for (String fileName : testResourceFiles.keySet()) {
|
||||||
TestSourceFile testFile = testResourceFiles.get(fileName);
|
TestSourceFile testFile = testResourceFiles.get(fileName);
|
||||||
String code = generateSource(testFile);
|
String code = generateSource(testFile);
|
||||||
assertEquals(TestHelper.unifyNewLines(testFile.getExpectedSource()), TestHelper.unifyNewLines(code + System.getProperty("line.separator"))); //$NON-NLS-1$
|
assertEquals(TestHelper.unifyNewLines(testFile.getExpectedSource()),
|
||||||
|
TestHelper.unifyNewLines(code + System.getProperty("line.separator"))); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ public class SourceRewriteTester extends TestSuite {
|
||||||
TestSuite suite = new TestSuite(name);
|
TestSuite suite = new TestSuite(name);
|
||||||
Iterator<RewriteBaseTest> it = testCases.iterator();
|
Iterator<RewriteBaseTest> it = testCases.iterator();
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
RewriteBaseTest subject =it.next();
|
RewriteBaseTest subject = it.next();
|
||||||
suite.addTest(subject);
|
suite.addTest(subject);
|
||||||
}
|
}
|
||||||
return suite;
|
return suite;
|
||||||
|
@ -88,11 +88,11 @@ public class SourceRewriteTester extends TestSuite {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ArrayList<RewriteBaseTest> createTests(BufferedReader inputReader) throws Exception {
|
private static ArrayList<RewriteBaseTest> createTests(BufferedReader inputReader) throws Exception {
|
||||||
String line;
|
|
||||||
ASTWriterTestSourceFile file = null;
|
ASTWriterTestSourceFile file = null;
|
||||||
MatcherState matcherState = MatcherState.skip;
|
MatcherState matcherState = MatcherState.skip;
|
||||||
ArrayList<RewriteBaseTest> testCases = new ArrayList<RewriteBaseTest>();
|
ArrayList<RewriteBaseTest> testCases = new ArrayList<RewriteBaseTest>();
|
||||||
|
|
||||||
|
String line;
|
||||||
while ((line = inputReader.readLine()) != null) {
|
while ((line = inputReader.readLine()) != null) {
|
||||||
if (lineMatchesBeginOfTest(line)) {
|
if (lineMatchesBeginOfTest(line)) {
|
||||||
matcherState = MatcherState.inTest;
|
matcherState = MatcherState.inTest;
|
||||||
|
@ -156,7 +156,7 @@ public class SourceRewriteTester extends TestSuite {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static RewriteBaseTest createTestClass(String testName, ASTWriterTestSourceFile file) throws Exception {
|
private static RewriteBaseTest createTestClass(String testName, ASTWriterTestSourceFile file) throws Exception {
|
||||||
ASTWriterTest test = new ASTWriterTest(testName,file);
|
ASTWriterTest test = new ASTWriterTest(testName, file);
|
||||||
TextSelection sel = file.getSelection();
|
TextSelection sel = file.getSelection();
|
||||||
if (sel != null) {
|
if (sel != null) {
|
||||||
test.setFileWithSelection(file.getName());
|
test.setFileWithSelection(file.getName());
|
||||||
|
|
|
@ -49,7 +49,7 @@ public abstract class ChangeGeneratorTest extends BaseTestFramework {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void runTest() throws Exception{
|
public void runTest() throws Exception {
|
||||||
final ASTModificationStore modStore = new ASTModificationStore();
|
final ASTModificationStore modStore = new ASTModificationStore();
|
||||||
IFile testFile = importFile("source.h", source); //$NON-NLS-1$
|
IFile testFile = importFile("source.h", source); //$NON-NLS-1$
|
||||||
|
|
||||||
|
|
|
@ -13,12 +13,12 @@ package org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.insertbefore;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTStandardFunctionDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTStandardFunctionDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTParameterDeclaration;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTParameterDeclaration;
|
||||||
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
||||||
|
@ -29,26 +29,26 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTParameterDeclaration;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSimpleDeclSpecifier;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSimpleDeclSpecifier;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSimpleDeclaration;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSimpleDeclaration;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification.ModificationKind;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification.ModificationKind;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Emanuel Graf IFS
|
* @author Emanuel Graf IFS
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class AddDeclarationBug extends ChangeGeneratorTest {
|
public class AddDeclarationBug extends ChangeGeneratorTest {
|
||||||
|
|
||||||
|
AddDeclarationBug() {
|
||||||
|
super("AddDeclarationBug");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Test suite() {
|
||||||
|
return new AddDeclarationBug();
|
||||||
public AddDeclarationBug() {
|
|
||||||
super("Add Declaration Bug Test");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
source = "class A\n{\npublic:\n A();\n virtual ~A();\n int foo();\n \nprivate:\n int help();\n};"; //$NON-NLS-1$
|
source = "class A\n{\npublic:\n A();\n virtual ~A();\n int foo();\n \nprivate:\n int help();\n};"; //$NON-NLS-1$
|
||||||
expectedSource = "class A\n{\npublic:\n A();\n virtual ~A();\n int foo();\n \nprivate:\n int help();\n int exp(int i);\n};"; //$NON-NLS-1$
|
expectedSource = "class A\n{\npublic:\n A();\n virtual ~A();\n int foo();\n \nprivate:\n int help();\n\tint exp(int i);\n};"; //$NON-NLS-1$
|
||||||
super.setUp();
|
super.setUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,8 +84,4 @@ public class AddDeclarationBug extends ChangeGeneratorTest {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
|
||||||
return new AddDeclarationBug();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,34 +13,38 @@ package org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.insertbefore;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
|
import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
import org.eclipse.cdt.core.dom.ast.IASTLiteralExpression;
|
||||||
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTArrayModifier;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTArrayModifier;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTLiteralExpression;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTLiteralExpression;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification.ModificationKind;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification.ModificationKind;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
|
|
||||||
public class ArrayModifierTest extends ChangeGeneratorTest {
|
public class ArrayModifierTest extends ChangeGeneratorTest {
|
||||||
|
|
||||||
public ArrayModifierTest(){
|
ArrayModifierTest() {
|
||||||
super("Replace Array Modifier"); //$NON-NLS-1$
|
super("ArrayModifierTest");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Test suite() {
|
||||||
|
return new ArrayModifierTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
source = "int *pi[3];"; //$NON-NLS-1$
|
source = "int* pi[3];"; //$NON-NLS-1$
|
||||||
expectedSource = "int *pi[5][3];"; //$NON-NLS-1$
|
expectedSource = "int* pi[5][3];"; //$NON-NLS-1$
|
||||||
super.setUp();
|
super.setUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ASTVisitor createModificator(
|
protected ASTVisitor createModificator(final ASTModificationStore modStore) {
|
||||||
final ASTModificationStore modStore) {
|
|
||||||
return new ASTVisitor() {
|
return new ASTVisitor() {
|
||||||
{
|
{
|
||||||
shouldVisitDeclarators = true;
|
shouldVisitDeclarators = true;
|
||||||
|
@ -49,11 +53,12 @@ public class ArrayModifierTest extends ChangeGeneratorTest {
|
||||||
@Override
|
@Override
|
||||||
public int visit(IASTDeclarator declarator) {
|
public int visit(IASTDeclarator declarator) {
|
||||||
if (declarator instanceof IASTArrayDeclarator) {
|
if (declarator instanceof IASTArrayDeclarator) {
|
||||||
IASTArrayDeclarator arrayDeclarator = (IASTArrayDeclarator)declarator;
|
IASTArrayDeclarator arrayDeclarator = (IASTArrayDeclarator) declarator;
|
||||||
|
|
||||||
IASTArrayModifier[] modifiers = arrayDeclarator.getArrayModifiers();
|
IASTArrayModifier[] modifiers = arrayDeclarator.getArrayModifiers();
|
||||||
IASTArrayModifier newModifier = new CPPASTArrayModifier();
|
IASTArrayModifier newModifier = new CPPASTArrayModifier();
|
||||||
IASTExpression expr = new CPPASTLiteralExpression(0, "5"); //$NON-NLS-1$
|
IASTExpression expr =
|
||||||
|
new CPPASTLiteralExpression(IASTLiteralExpression.lk_integer_constant, "5".toCharArray()); //$NON-NLS-1$
|
||||||
newModifier.setConstantExpression(expr);
|
newModifier.setConstantExpression(expr);
|
||||||
ASTModification modification = new ASTModification(ModificationKind.INSERT_BEFORE, modifiers[0], newModifier, null);
|
ASTModification modification = new ASTModification(ModificationKind.INSERT_BEFORE, modifiers[0], newModifier, null);
|
||||||
modStore.storeModification(null, modification);
|
modStore.storeModification(null, modification);
|
||||||
|
@ -62,8 +67,4 @@ public class ArrayModifierTest extends ChangeGeneratorTest {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
|
||||||
return new ArrayModifierTest();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,11 +13,12 @@ package org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.insertbefore;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
|
import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTLiteralExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNewExpression;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNewExpression;
|
||||||
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTArrayModifier;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTArrayModifier;
|
||||||
|
@ -25,25 +26,25 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTLiteralExpression;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class ArraySizeExpressionTest extends ChangeGeneratorTest {
|
public class ArraySizeExpressionTest extends ChangeGeneratorTest {
|
||||||
|
|
||||||
public ArraySizeExpressionTest(){
|
ArraySizeExpressionTest() {
|
||||||
super("Insert Array Size Expression"); //$NON-NLS-1$
|
super("ArraySizeExpressionTest");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Test suite() {
|
||||||
|
return new ArraySizeExpressionTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
source = "int *values = new int[5];"; //$NON-NLS-1$
|
source = "int* values = new int[5];"; //$NON-NLS-1$
|
||||||
expectedSource = "int *values = new int[6][5];"; //$NON-NLS-1$
|
expectedSource = "int* values = new int[6][5];"; //$NON-NLS-1$
|
||||||
super.setUp();
|
super.setUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ASTVisitor createModificator(
|
protected ASTVisitor createModificator(final ASTModificationStore modStore) {
|
||||||
final ASTModificationStore modStore) {
|
|
||||||
return new ASTVisitor() {
|
return new ASTVisitor() {
|
||||||
{
|
{
|
||||||
shouldVisitExpressions = true;
|
shouldVisitExpressions = true;
|
||||||
|
@ -56,7 +57,8 @@ public class ArraySizeExpressionTest extends ChangeGeneratorTest {
|
||||||
IASTTypeId id= newExpression.getTypeId();
|
IASTTypeId id= newExpression.getTypeId();
|
||||||
IASTArrayDeclarator dtor= (IASTArrayDeclarator) id.getAbstractDeclarator();
|
IASTArrayDeclarator dtor= (IASTArrayDeclarator) id.getAbstractDeclarator();
|
||||||
IASTArrayModifier[] mods= dtor.getArrayModifiers();
|
IASTArrayModifier[] mods= dtor.getArrayModifiers();
|
||||||
IASTArrayModifier add= new CPPASTArrayModifier(new CPPASTLiteralExpression(0, "6"));
|
IASTArrayModifier add= new CPPASTArrayModifier(
|
||||||
|
new CPPASTLiteralExpression(IASTLiteralExpression.lk_integer_constant, "6".toCharArray()));
|
||||||
ASTModification modification = new ASTModification(ASTModification.ModificationKind.INSERT_BEFORE, mods[0], add, null);
|
ASTModification modification = new ASTModification(ASTModification.ModificationKind.INSERT_BEFORE, mods[0], add, null);
|
||||||
modStore.storeModification(null, modification);
|
modStore.storeModification(null, modification);
|
||||||
}
|
}
|
||||||
|
@ -64,9 +66,4 @@ public class ArraySizeExpressionTest extends ChangeGeneratorTest {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
|
||||||
return new ArraySizeExpressionTest();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,8 @@ package org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.insertbefore;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTConstructorChainInitializer;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTConstructorChainInitializer;
|
||||||
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTConstructorChainInitializer;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTConstructorChainInitializer;
|
||||||
|
@ -22,25 +22,28 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDeclarator;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTIdExpression;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTIdExpression;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTName;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTName;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification.ModificationKind;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification.ModificationKind;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
|
|
||||||
public class CtorChainInitializerTest extends ChangeGeneratorTest {
|
public class CtorChainInitializerTest extends ChangeGeneratorTest {
|
||||||
|
|
||||||
public CtorChainInitializerTest(){
|
CtorChainInitializerTest() {
|
||||||
super("Insert Before Ctor Initializer"); //$NON-NLS-1$
|
super("CtorChainInitializerTest");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Test suite() {
|
||||||
|
return new CtorChainInitializerTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
source = "TestClass::TestClass(int a, int b):beta(b){\n}\n\n"; //$NON-NLS-1$
|
source = "TestClass::TestClass(int a, int b):beta(b) {\n}\n\n"; //$NON-NLS-1$
|
||||||
expectedSource = "TestClass::TestClass(int a, int b):alpha(a), beta(b){\n}\n\n"; //$NON-NLS-1$
|
expectedSource = "TestClass::TestClass(int a, int b) :\n\t\talpha(a), beta(b) {\n}\n\n"; //$NON-NLS-1$
|
||||||
super.setUp();
|
super.setUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ASTVisitor createModificator(
|
protected ASTVisitor createModificator(final ASTModificationStore modStore) {
|
||||||
final ASTModificationStore modStore) {
|
|
||||||
return new ASTVisitor() {
|
return new ASTVisitor() {
|
||||||
{
|
{
|
||||||
shouldVisitDeclarators = true;
|
shouldVisitDeclarators = true;
|
||||||
|
@ -49,7 +52,7 @@ public class CtorChainInitializerTest extends ChangeGeneratorTest {
|
||||||
@Override
|
@Override
|
||||||
public int visit(IASTDeclarator declarator) {
|
public int visit(IASTDeclarator declarator) {
|
||||||
if (declarator instanceof CPPASTFunctionDeclarator) {
|
if (declarator instanceof CPPASTFunctionDeclarator) {
|
||||||
CPPASTFunctionDeclarator functionDeclarator = (CPPASTFunctionDeclarator)declarator;
|
CPPASTFunctionDeclarator functionDeclarator = (CPPASTFunctionDeclarator) declarator;
|
||||||
ICPPASTConstructorChainInitializer ctorInitializer = functionDeclarator.getConstructorChain()[0];
|
ICPPASTConstructorChainInitializer ctorInitializer = functionDeclarator.getConstructorChain()[0];
|
||||||
CPPASTIdExpression initExpr = new CPPASTIdExpression(new CPPASTName("a".toCharArray())); //$NON-NLS-1$
|
CPPASTIdExpression initExpr = new CPPASTIdExpression(new CPPASTName("a".toCharArray())); //$NON-NLS-1$
|
||||||
CPPASTName initName = new CPPASTName("alpha".toCharArray()); //$NON-NLS-1$
|
CPPASTName initName = new CPPASTName("alpha".toCharArray()); //$NON-NLS-1$
|
||||||
|
@ -63,9 +66,4 @@ public class CtorChainInitializerTest extends ChangeGeneratorTest {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
|
||||||
return new CtorChainInitializerTest();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,10 +13,10 @@ package org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.insertbefore;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTDeclarator;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTDeclarator;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDeclarator;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDeclarator;
|
||||||
|
@ -24,13 +24,17 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTName;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSimpleDeclSpecifier;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSimpleDeclSpecifier;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTTypeId;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTTypeId;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification.ModificationKind;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification.ModificationKind;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
|
|
||||||
public class ExceptionTest extends ChangeGeneratorTest {
|
public class ExceptionTest extends ChangeGeneratorTest {
|
||||||
|
|
||||||
public ExceptionTest(){
|
ExceptionTest() {
|
||||||
super("Insert Before Exception Declaration"); //$NON-NLS-1$
|
super("ExceptionTest");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Test suite() {
|
||||||
|
return new ExceptionTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -41,8 +45,7 @@ public class ExceptionTest extends ChangeGeneratorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ASTVisitor createModificator(
|
protected ASTVisitor createModificator(final ASTModificationStore modStore) {
|
||||||
final ASTModificationStore modStore) {
|
|
||||||
return new ASTVisitor() {
|
return new ASTVisitor() {
|
||||||
{
|
{
|
||||||
shouldVisitDeclarators = true;
|
shouldVisitDeclarators = true;
|
||||||
|
@ -69,9 +72,4 @@ public class ExceptionTest extends ChangeGeneratorTest {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
|
||||||
return new ExceptionTest();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,10 +13,10 @@ package org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.insertbefore;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpressionList;
|
import org.eclipse.cdt.core.dom.ast.IASTExpressionList;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTBinaryExpression;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTBinaryExpression;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTIdExpression;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTIdExpression;
|
||||||
|
@ -25,14 +25,14 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTName;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class ExpressionTest extends ChangeGeneratorTest {
|
public class ExpressionTest extends ChangeGeneratorTest {
|
||||||
|
|
||||||
public ExpressionTest(){
|
ExpressionTest() {
|
||||||
super("Insert Expression"); //$NON-NLS-1$
|
super("ExpressionTest");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Test suite() {
|
||||||
|
return new ExpressionTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -43,8 +43,7 @@ public class ExpressionTest extends ChangeGeneratorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ASTVisitor createModificator(
|
protected ASTVisitor createModificator(final ASTModificationStore modStore) {
|
||||||
final ASTModificationStore modStore) {
|
|
||||||
return new ASTVisitor() {
|
return new ASTVisitor() {
|
||||||
{
|
{
|
||||||
shouldVisitExpressions = true;
|
shouldVisitExpressions = true;
|
||||||
|
@ -63,9 +62,4 @@ public class ExpressionTest extends ChangeGeneratorTest {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
|
||||||
return new ExpressionTest();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,10 +13,10 @@ package org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.insertbefore;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTDeclarator;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTDeclarator;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDeclarator;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDeclarator;
|
||||||
|
@ -24,17 +24,17 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTName;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTParameterDeclaration;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTParameterDeclaration;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSimpleDeclSpecifier;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSimpleDeclSpecifier;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification.ModificationKind;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification.ModificationKind;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class FirstParameterTest extends ChangeGeneratorTest {
|
public class FirstParameterTest extends ChangeGeneratorTest {
|
||||||
|
|
||||||
public FirstParameterTest(){
|
FirstParameterTest() {
|
||||||
super("Insert Before First Parameter"); //$NON-NLS-1$
|
super("FirstParameterTest");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Test suite() {
|
||||||
|
return new FirstParameterTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -44,10 +44,8 @@ public class FirstParameterTest extends ChangeGeneratorTest {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ASTVisitor createModificator(
|
protected ASTVisitor createModificator(final ASTModificationStore modStore) {
|
||||||
final ASTModificationStore modStore) {
|
|
||||||
return new ASTVisitor() {
|
return new ASTVisitor() {
|
||||||
{
|
{
|
||||||
shouldVisitDeclarators = true;
|
shouldVisitDeclarators = true;
|
||||||
|
@ -77,9 +75,4 @@ public class FirstParameterTest extends ChangeGeneratorTest {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
|
||||||
return new FirstParameterTest();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,12 +16,11 @@ import junit.framework.TestSuite;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Thomas Corbat
|
* @author Thomas Corbat
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class InsertBeforeTestSuite{
|
public class InsertBeforeTestSuite {
|
||||||
|
|
||||||
public static Test suite() throws Exception {
|
public static Test suite() throws Exception {
|
||||||
TestSuite suite = new TestSuite("Changegenerator InsertBefore Tests");
|
TestSuite suite = new TestSuite("ChangeGenerator InsertBefore Tests");
|
||||||
|
|
||||||
suite.addTest(FirstParameterTest.suite());
|
suite.addTest(FirstParameterTest.suite());
|
||||||
suite.addTest(PointerParameterTest.suite());
|
suite.addTest(PointerParameterTest.suite());
|
||||||
|
|
|
@ -13,44 +13,38 @@ package org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.insertbefore;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclarationStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclarationStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTForStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTForStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTSimpleDeclSpecifier;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTSimpleDeclSpecifier;
|
||||||
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPNodeFactory;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPNodeFactory;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class MultilineWhitespaceHandlingTest extends ChangeGeneratorTest {
|
public class MultilineWhitespaceHandlingTest extends ChangeGeneratorTest {
|
||||||
|
|
||||||
public MultilineWhitespaceHandlingTest(){
|
MultilineWhitespaceHandlingTest() {
|
||||||
super("Multiline Whitespace Handling"); //$NON-NLS-1$
|
super("MultilineWhitespaceHandlingTest");
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
source = "void foo(){\r\n\r\n for(int i = 0; i < 10; i++){\r\n\r\n }\r\n}\r\n"; //$NON-NLS-1$
|
|
||||||
expectedSource = "void foo(){\r\n\r\n for(int i = 0; i < 10; i++){\r\n int i;\r\n int j;\r\n\r\n }\r\n}\r\n"; //$NON-NLS-1$
|
|
||||||
super.setUp();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
return new MultilineWhitespaceHandlingTest();
|
return new MultilineWhitespaceHandlingTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setUp() throws Exception {
|
||||||
|
source = "void foo() {\r\n\r\n\tfor(int i = 0; i < 10; i++) {\r\n\r\n\t}\r\n}\r\n"; //$NON-NLS-1$
|
||||||
|
expectedSource = "void foo() {\r\n\r\n\tfor(int i = 0; i < 10; i++) {\r\n\t\tint i;\r\n\t\tint j;\r\n\r\n\t}\r\n}\r\n"; //$NON-NLS-1$
|
||||||
|
super.setUp();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ASTVisitor createModificator(
|
protected ASTVisitor createModificator(final ASTModificationStore modStore) {
|
||||||
final ASTModificationStore modStore) {
|
|
||||||
return new ASTVisitor() {
|
return new ASTVisitor() {
|
||||||
{
|
{
|
||||||
shouldVisitStatements = true;
|
shouldVisitStatements = true;
|
||||||
|
|
|
@ -13,21 +13,25 @@ package org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.insertbefore;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTPointerOperator;
|
import org.eclipse.cdt.core.dom.ast.IASTPointerOperator;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDeclarator;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDeclarator;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTPointer;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTPointer;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification.ModificationKind;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification.ModificationKind;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
|
|
||||||
public class PointerParameterTest extends ChangeGeneratorTest {
|
public class PointerParameterTest extends ChangeGeneratorTest {
|
||||||
|
|
||||||
public PointerParameterTest(){
|
PointerParameterTest() {
|
||||||
super("Insert Pointer for Parameter"); //$NON-NLS-1$
|
super("PointerParameterTest");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Test suite() {
|
||||||
|
return new PointerParameterTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -38,8 +42,7 @@ public class PointerParameterTest extends ChangeGeneratorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ASTVisitor createModificator(
|
protected ASTVisitor createModificator(final ASTModificationStore modStore) {
|
||||||
final ASTModificationStore modStore) {
|
|
||||||
return new ASTVisitor() {
|
return new ASTVisitor() {
|
||||||
{
|
{
|
||||||
shouldVisitDeclarators = true;
|
shouldVisitDeclarators = true;
|
||||||
|
@ -63,9 +66,4 @@ public class PointerParameterTest extends ChangeGeneratorTest {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
|
||||||
return new PointerParameterTest();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,31 +21,25 @@ import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGenerator
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class SelfInsertionTest extends ChangeGeneratorTest {
|
public class SelfInsertionTest extends ChangeGeneratorTest {
|
||||||
|
|
||||||
public SelfInsertionTest(){
|
SelfInsertionTest() {
|
||||||
super("Self Insertion Test"); //$NON-NLS-1$
|
super("SelfInsertionTest");
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
source = "void foo(){\r\n\r\n for(int i = 0; i < 10; i++){\r\n }\r\n}\r\n"; //$NON-NLS-1$
|
|
||||||
expectedSource = "void foo(){\r\n\r\n for(int i = 0; i < 10; i++){\r\n for(int i = 0;i < 10;i++){\r\n }\r\n }\r\n}\r\n"; //$NON-NLS-1$
|
|
||||||
super.setUp();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
return new SelfInsertionTest();
|
return new SelfInsertionTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setUp() throws Exception {
|
||||||
|
source = "void foo() {\r\n\r\n\tfor (int i = 0; i < 10; i++) {\r\n\t}\r\n}\r\n"; //$NON-NLS-1$
|
||||||
|
expectedSource = "void foo() {\r\n\r\n\tfor (int i = 0; i < 10; i++) {\r\n\t\tfor (int i = 0; i < 10; i++) {\r\n\t\t}\r\n\t}\r\n}\r\n"; //$NON-NLS-1$
|
||||||
|
super.setUp();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ASTVisitor createModificator(
|
protected ASTVisitor createModificator(final ASTModificationStore modStore) {
|
||||||
final ASTModificationStore modStore) {
|
|
||||||
return new ASTVisitor() {
|
return new ASTVisitor() {
|
||||||
{
|
{
|
||||||
shouldVisitStatements = true;
|
shouldVisitStatements = true;
|
||||||
|
|
|
@ -13,10 +13,10 @@ package org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.replace;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
|
||||||
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompositeTypeSpecifier;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompositeTypeSpecifier;
|
||||||
|
@ -25,32 +25,25 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSimpleDeclaration;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class MoveRenameTest extends ChangeGeneratorTest {
|
public class MoveRenameTest extends ChangeGeneratorTest {
|
||||||
|
|
||||||
public MoveRenameTest(){
|
MoveRenameTest() {
|
||||||
super("Swap Rename Declarations"); //$NON-NLS-1$
|
super("MoveRenameTest");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
|
|
||||||
source = "#ifndef A_H_\r\n#define A_H_\r\n\r\nclass A {\r\n\r\nprivate:\r\n int b;\r\n int a;\r\n};\r\n\r\n#endif /*A_H_*/\r\n\r\n"; //$NON-NLS-1$
|
|
||||||
expectedSource = "#ifndef A_H_\r\n#define A_H_\r\n\r\nclass A {\r\n\r\nprivate:\r\n int d;\r\n int b;\r\n};\r\n\r\n#endif /*A_H_*/\r\n\r\n"; //$NON-NLS-1$
|
|
||||||
super.setUp();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
return new MoveRenameTest();
|
return new MoveRenameTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ASTVisitor createModificator(
|
protected void setUp() throws Exception {
|
||||||
final ASTModificationStore modStore) {
|
source = "#ifndef A_H_\r\n#define A_H_\r\n\r\nclass A {\r\n\r\nprivate:\r\n\tint b;\r\n\tint a;\r\n};\r\n\r\n#endif /*A_H_*/\r\n\r\n"; //$NON-NLS-1$
|
||||||
|
expectedSource = "#ifndef A_H_\r\n#define A_H_\r\n\r\nclass A {\r\n\r\nprivate:\r\n\tint d;\r\n\tint b;\r\n};\r\n\r\n#endif /*A_H_*/\r\n\r\n"; //$NON-NLS-1$
|
||||||
|
super.setUp();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ASTVisitor createModificator(final ASTModificationStore modStore) {
|
||||||
return new ASTVisitor() {
|
return new ASTVisitor() {
|
||||||
{
|
{
|
||||||
shouldVisitDeclSpecifiers = true;
|
shouldVisitDeclSpecifiers = true;
|
||||||
|
@ -70,8 +63,6 @@ public class MoveRenameTest extends ChangeGeneratorTest {
|
||||||
}
|
}
|
||||||
return super.visit(declSpec);
|
return super.visit(declSpec);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,40 +13,34 @@ package org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.replace;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
|
||||||
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompositeTypeSpecifier;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompositeTypeSpecifier;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class MoveTest extends ChangeGeneratorTest {
|
public class MoveTest extends ChangeGeneratorTest {
|
||||||
|
|
||||||
public MoveTest(){
|
MoveTest() {
|
||||||
super("Swap Declarations"); //$NON-NLS-1$
|
super("MoveTest");
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
source = "#ifndef A_H_\r\n#define A_H_\r\n\r\nclass A {\r\n\r\nprivate:\r\n int b;\r\n int a;\r\n};\r\n\r\n#endif /*A_H_*/\r\n\r\n"; //$NON-NLS-1$
|
|
||||||
expectedSource = "#ifndef A_H_\r\n#define A_H_\r\n\r\nclass A {\r\n\r\nprivate:\r\n int a;\r\n int b;\r\n};\r\n\r\n#endif /*A_H_*/\r\n\r\n"; //$NON-NLS-1$
|
|
||||||
super.setUp();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
return new MoveTest();
|
return new MoveTest();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ASTVisitor createModificator(
|
protected void setUp() throws Exception {
|
||||||
final ASTModificationStore modStore) {
|
source = "#ifndef A_H_\r\n#define A_H_\r\n\r\nclass A {\r\n\r\nprivate:\r\n\tint b;\r\n\tint a;\r\n};\r\n\r\n#endif /*A_H_*/\r\n\r\n"; //$NON-NLS-1$
|
||||||
|
expectedSource = "#ifndef A_H_\r\n#define A_H_\r\n\r\nclass A {\r\n\r\nprivate:\r\n\tint a;\r\n\tint b;\r\n};\r\n\r\n#endif /*A_H_*/\r\n\r\n"; //$NON-NLS-1$
|
||||||
|
super.setUp();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ASTVisitor createModificator(final ASTModificationStore modStore) {
|
||||||
return new ASTVisitor() {
|
return new ASTVisitor() {
|
||||||
{
|
{
|
||||||
shouldVisitDeclSpecifiers = true;
|
shouldVisitDeclSpecifiers = true;
|
||||||
|
@ -64,8 +58,6 @@ public class MoveTest extends ChangeGeneratorTest {
|
||||||
}
|
}
|
||||||
return super.visit(declSpec);
|
return super.visit(declSpec);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ package org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.replace;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpressionStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTExpressionStatement;
|
||||||
|
@ -20,7 +21,6 @@ import org.eclipse.cdt.core.dom.ast.IASTIdExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTLiteralExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTLiteralExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTUnaryExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTUnaryExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTBinaryExpression;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTBinaryExpression;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTExpressionStatement;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTExpressionStatement;
|
||||||
|
@ -33,43 +33,37 @@ import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
|
|
||||||
public class ReplaceInsertStatementTest extends ChangeGeneratorTest {
|
public class ReplaceInsertStatementTest extends ChangeGeneratorTest {
|
||||||
|
|
||||||
public ReplaceInsertStatementTest() {
|
ReplaceInsertStatementTest() {
|
||||||
super("Replace Insert Statement Test");
|
super("ReplaceInsertStatementTest");
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
source = "void main(){\r\n int i = 0;\r\n ++i;\r\n}"; //$NON-NLS-1$
|
|
||||||
expectedSource = "void main(){\r\n int i = 0;\r\n i = 42;\r\n i++;\r\n}"; //$NON-NLS-1$
|
|
||||||
super.setUp();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
return new ReplaceInsertStatementTest();
|
return new ReplaceInsertStatementTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest#createModificator(org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected ASTVisitor createModificator(
|
protected void setUp() throws Exception {
|
||||||
final ASTModificationStore modStore) {
|
source = "void main() {\r\n\tint i = 0;\r\n\t++i;\r\n}"; //$NON-NLS-1$
|
||||||
|
expectedSource = "void main() {\r\n\tint i = 0;\r\n\ti = 42;\r\n\ti++;\r\n}"; //$NON-NLS-1$
|
||||||
|
super.setUp();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ASTVisitor createModificator(final ASTModificationStore modStore) {
|
||||||
return new ASTVisitor() {
|
return new ASTVisitor() {
|
||||||
{
|
{
|
||||||
shouldVisitStatements = true;
|
shouldVisitStatements = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int visit(IASTStatement statement) {
|
public int visit(IASTStatement statement) {
|
||||||
if (statement instanceof IASTCompoundStatement) {
|
if (statement instanceof IASTCompoundStatement) {
|
||||||
IASTCompoundStatement compStmt = (IASTCompoundStatement) statement;
|
IASTCompoundStatement compStmt = (IASTCompoundStatement) statement;
|
||||||
IASTStatement stmt = compStmt.getStatements()[1];
|
IASTStatement stmt = compStmt.getStatements()[1];
|
||||||
|
|
||||||
IASTIdExpression id = new CPPASTIdExpression(
|
IASTIdExpression id = new CPPASTIdExpression(new CPPASTName("i".toCharArray()));
|
||||||
new CPPASTName("i".toCharArray()));
|
|
||||||
IASTLiteralExpression value = new CPPASTLiteralExpression(
|
IASTLiteralExpression value = new CPPASTLiteralExpression(
|
||||||
IASTLiteralExpression.lk_integer_constant, "42");
|
IASTLiteralExpression.lk_integer_constant, "42".toCharArray());
|
||||||
IASTExpressionStatement insertStmt = new CPPASTExpressionStatement(
|
IASTExpressionStatement insertStmt = new CPPASTExpressionStatement(
|
||||||
new CPPASTBinaryExpression(
|
new CPPASTBinaryExpression(
|
||||||
IASTBinaryExpression.op_assign, id, value));
|
IASTBinaryExpression.op_assign, id, value));
|
||||||
|
@ -82,15 +76,12 @@ public class ReplaceInsertStatementTest extends ChangeGeneratorTest {
|
||||||
incExp);
|
incExp);
|
||||||
|
|
||||||
ASTModification replaceMod = new ASTModification(
|
ASTModification replaceMod = new ASTModification(
|
||||||
ASTModification.ModificationKind.REPLACE, stmt,
|
ASTModification.ModificationKind.REPLACE, stmt, replaceStatement, null);
|
||||||
replaceStatement, null);
|
|
||||||
modStore.storeModification(null, replaceMod);
|
modStore.storeModification(null, replaceMod);
|
||||||
|
|
||||||
ASTModification insertMod = new ASTModification(
|
ASTModification insertMod = new ASTModification(
|
||||||
ASTModification.ModificationKind.INSERT_BEFORE,
|
ASTModification.ModificationKind.INSERT_BEFORE, stmt, insertStmt, null);
|
||||||
stmt, insertStmt, null);
|
|
||||||
modStore.storeModification(null, insertMod);
|
modStore.storeModification(null, insertMod);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return PROCESS_CONTINUE;
|
return PROCESS_CONTINUE;
|
||||||
|
|
|
@ -13,10 +13,10 @@ package org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.replace;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTIfStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTIfStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTUnaryExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTUnaryExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompoundStatement;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompoundStatement;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTExpressionStatement;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTExpressionStatement;
|
||||||
|
@ -26,31 +26,25 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTUnaryExpression;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class StatementTest extends ChangeGeneratorTest {
|
public class StatementTest extends ChangeGeneratorTest {
|
||||||
|
|
||||||
public StatementTest(){
|
StatementTest() {
|
||||||
super("Replace Then-Statement"); //$NON-NLS-1$
|
super("StatementTest");
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
source = "int f()\r\n{\r\n\tint i = 0;\r\n\tif(i < 1){\r\n\t\t++i;\r\n\t}\r\n}\r\n"; //$NON-NLS-1$
|
|
||||||
expectedSource = "int f()\r\n{\r\n\tint i = 0;\r\n\tif(i < 1){\r\n\t i++;\r\n\t}\r\n}\r\n"; //$NON-NLS-1$
|
|
||||||
super.setUp();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
return new StatementTest();
|
return new StatementTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setUp() throws Exception {
|
||||||
|
source = "int f()\r\n{\r\n\tint i = 0;\r\n\tif (i < 1) {\r\n\t\t++i;\r\n\t}\r\n}\r\n"; //$NON-NLS-1$
|
||||||
|
expectedSource = "int f()\r\n{\r\n\tint i = 0;\r\n\tif (i < 1) {\r\n\t\ti++;\r\n\t}\r\n}\r\n"; //$NON-NLS-1$
|
||||||
|
super.setUp();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ASTVisitor createModificator(
|
protected ASTVisitor createModificator(final ASTModificationStore modStore) {
|
||||||
final ASTModificationStore modStore) {
|
|
||||||
return new ASTVisitor() {
|
return new ASTVisitor() {
|
||||||
{
|
{
|
||||||
shouldVisitStatements = true;
|
shouldVisitStatements = true;
|
||||||
|
|
|
@ -11,11 +11,12 @@ const int a = 1;
|
||||||
//Test3
|
//Test3
|
||||||
volatile int b = 3;
|
volatile int b = 3;
|
||||||
//Test4
|
//Test4
|
||||||
typedef int *intp;
|
typedef int* intp;
|
||||||
//Test5
|
//Test5
|
||||||
extern int b;
|
extern int b;
|
||||||
//Test6
|
//Test6
|
||||||
static int c;
|
static int c;
|
||||||
|
|
||||||
//Test7
|
//Test7
|
||||||
int foo()
|
int foo()
|
||||||
{
|
{
|
||||||
|
@ -59,7 +60,7 @@ public:
|
||||||
//!Commented ElaboratedTypeSpecifier 1
|
//!Commented ElaboratedTypeSpecifier 1
|
||||||
//%CPP
|
//%CPP
|
||||||
//Test1
|
//Test1
|
||||||
class A *A; //Test2
|
class A* A; //Test2
|
||||||
//Test3
|
//Test3
|
||||||
enum Status{ good, bad}; //Test4
|
enum Status{ good, bad}; //Test4
|
||||||
//Test5
|
//Test5
|
||||||
|
|
|
@ -76,42 +76,51 @@ extern "C" typedef void FUNC(); /*TEST 2*/
|
||||||
//!Commented NamespaceAlias 1
|
//!Commented NamespaceAlias 1
|
||||||
//%CPP
|
//%CPP
|
||||||
//TEST 1
|
//TEST 1
|
||||||
namespace kurz = ziemlichlangernamespace; //TEST 2
|
namespace kurz = somenamespace; //TEST 2
|
||||||
|
|
||||||
//!Commented NamespaceAlias 2
|
//!Commented NamespaceAlias 2
|
||||||
//%CPP
|
//%CPP
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
namespace kurz = ziemlichlangernamespace; /*TEST 2*/
|
namespace kurz = somenamespace; /*TEST 2*/
|
||||||
|
|
||||||
//!Commented NamespaceDefinition 1
|
//!Commented NamespaceDefinition 1
|
||||||
//%CPP
|
//%CPP
|
||||||
//TEST 1
|
//TEST 1
|
||||||
namespace ziemlichlangernamespace
|
namespace namespace1
|
||||||
{
|
{
|
||||||
//TEST 2
|
|
||||||
|
//TEST 2
|
||||||
|
|
||||||
} //TEST 3
|
} //TEST 3
|
||||||
|
|
||||||
//!Commented NamespaceDefinition 2
|
//!Commented NamespaceDefinition 2
|
||||||
//%CPP
|
//%CPP
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
namespace ziemlichlangernamespace
|
namespace namespace2
|
||||||
{
|
{
|
||||||
/*TEST 2*/
|
|
||||||
|
/*TEST 2*/
|
||||||
|
|
||||||
} /*TEST 3*/
|
} /*TEST 3*/
|
||||||
|
|
||||||
//!Commented NamespaceDefinition 3
|
//!Commented NamespaceDefinition 3
|
||||||
//%CPP
|
//%CPP
|
||||||
namespace ziemlichlangernamespace
|
namespace namespace3
|
||||||
{
|
{
|
||||||
//TEST
|
|
||||||
|
//TEST
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//!Commented NamespaceDefinition 4
|
//!Commented NamespaceDefinition 4
|
||||||
//%CPP
|
//%CPP
|
||||||
namespace ziemlichlangernamespace
|
namespace namespace4
|
||||||
{
|
{
|
||||||
//TEST
|
|
||||||
|
//TEST
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void doIt()
|
void doIt()
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
@ -158,8 +167,9 @@ template<> class MyQueue<double> //TEST 2
|
||||||
{
|
{
|
||||||
//TEST 3
|
//TEST 3
|
||||||
std::vector<double> data;
|
std::vector<double> data;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Add(const double& );
|
void Add(const double&);
|
||||||
void Remove();
|
void Remove();
|
||||||
void Print();
|
void Print();
|
||||||
//TEST 4
|
//TEST 4
|
||||||
|
@ -173,8 +183,9 @@ template<> class MyQueue<double> /*TEST 2*/
|
||||||
{
|
{
|
||||||
/*TEST 3*/
|
/*TEST 3*/
|
||||||
std::vector<double> data;
|
std::vector<double> data;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Add(const double& );
|
void Add(const double&);
|
||||||
void Remove();
|
void Remove();
|
||||||
void Print();
|
void Print();
|
||||||
/*TEST 4*/
|
/*TEST 4*/
|
||||||
|
@ -214,9 +225,11 @@ class A
|
||||||
//TEST 1
|
//TEST 1
|
||||||
public: //TEST 2
|
public: //TEST 2
|
||||||
int hallo();
|
int hallo();
|
||||||
|
|
||||||
/*TEST 3*/
|
/*TEST 3*/
|
||||||
protected: /*TEST 4*/
|
protected: /*TEST 4*/
|
||||||
int b, c;
|
int b, c;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int p;
|
int p;
|
||||||
};
|
};
|
||||||
|
@ -231,13 +244,13 @@ int i = 2; //TEST 2
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
int i = 2; /*TEST 2*/
|
int i = 2; /*TEST 2*/
|
||||||
|
|
||||||
//!Commented typename qualfier 1
|
//!Commented typename qualifier 1
|
||||||
//%CPP
|
//%CPP
|
||||||
//TEST 1
|
//TEST 1
|
||||||
typename T::A *a6; //TEST 2
|
typename T::A* a6; //TEST 2
|
||||||
|
|
||||||
//!Commented typename qualfier 2
|
//!Commented typename qualifier 2
|
||||||
//%CPP
|
//%CPP
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
typename T::A *a6; /*TEST 2*/
|
typename T::A* a6; /*TEST 2*/
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ void foo()
|
||||||
{
|
{
|
||||||
int f();
|
int f();
|
||||||
};
|
};
|
||||||
int (B::* pb)() = &B::f;
|
int (B::*pb)() = &B::f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,13 +22,14 @@ void foo()
|
||||||
{
|
{
|
||||||
int f();
|
int f();
|
||||||
};
|
};
|
||||||
int (B::* pb)() = &B::f;
|
int (B::*pb)() = &B::f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!Commented CPPFunctionDeclaratorTest 1
|
//!Commented CPPFunctionDeclaratorTest 1
|
||||||
//%CPP
|
//%CPP
|
||||||
char & operator [](unsigned int);
|
char& operator [](unsigned int);
|
||||||
|
|
||||||
//TEST 1
|
//TEST 1
|
||||||
TestClass::TestClass(int a) //TEST 2
|
TestClass::TestClass(int a) //TEST 2
|
||||||
{
|
{
|
||||||
|
@ -38,7 +39,8 @@ TestClass::TestClass(int a) //TEST 2
|
||||||
|
|
||||||
//!Commented CPPFunctionDeclaratorTest 2
|
//!Commented CPPFunctionDeclaratorTest 2
|
||||||
//%CPP
|
//%CPP
|
||||||
char & operator [](unsigned int);
|
char& operator [](unsigned int);
|
||||||
|
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
TestClass::TestClass(int a) /*TEST 2*/
|
TestClass::TestClass(int a) /*TEST 2*/
|
||||||
{
|
{
|
||||||
|
@ -48,7 +50,8 @@ TestClass::TestClass(int a) /*TEST 2*/
|
||||||
|
|
||||||
//!Commented CPPFunctionDeclaratorTest 3
|
//!Commented CPPFunctionDeclaratorTest 3
|
||||||
//%CPP
|
//%CPP
|
||||||
char & operator [](unsigned int);
|
char& operator [](unsigned int);
|
||||||
|
|
||||||
//TEST 1
|
//TEST 1
|
||||||
TestClass::TestClass(int a)
|
TestClass::TestClass(int a)
|
||||||
:alpha(a) //TEST 2
|
:alpha(a) //TEST 2
|
||||||
|
@ -59,7 +62,8 @@ TestClass::TestClass(int a)
|
||||||
|
|
||||||
//!Commented CPPFunctionDeclaratorTest 4
|
//!Commented CPPFunctionDeclaratorTest 4
|
||||||
//%CPP
|
//%CPP
|
||||||
char & operator [](unsigned int);
|
char& operator [](unsigned int);
|
||||||
|
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
TestClass::TestClass(int a)
|
TestClass::TestClass(int a)
|
||||||
:alpha(a) /*TEST 3*/
|
:alpha(a) /*TEST 3*/
|
||||||
|
@ -76,7 +80,7 @@ void foo()
|
||||||
try {
|
try {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +94,7 @@ void foo()
|
||||||
try {
|
try {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,7 +108,7 @@ void foo()
|
||||||
//Test
|
//Test
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,7 +122,7 @@ void foo()
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,7 +136,7 @@ void foo()
|
||||||
//Test
|
//Test
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,7 +149,7 @@ void foo()
|
||||||
try {
|
try {
|
||||||
i++; //Test
|
i++; //Test
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,7 +163,7 @@ void foo()
|
||||||
i++;
|
i++;
|
||||||
//Test
|
//Test
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,7 +176,7 @@ void foo()
|
||||||
try {
|
try {
|
||||||
i++;
|
i++;
|
||||||
} //Test
|
} //Test
|
||||||
catch(...){
|
catch (...){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,7 +189,7 @@ void foo()
|
||||||
try {
|
try {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
//Test
|
//Test
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -199,7 +203,7 @@ void foo()
|
||||||
try {
|
try {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
//Test
|
//Test
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -213,7 +217,7 @@ void foo()
|
||||||
try {
|
try {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
}
|
}
|
||||||
//Test
|
//Test
|
||||||
}
|
}
|
||||||
|
@ -227,9 +231,9 @@ void foo()
|
||||||
try {
|
try {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
catch(Overflow oo){
|
catch (Overflow oo){
|
||||||
}
|
}
|
||||||
catch(Matherr mm){
|
catch (Matherr mm){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,9 +246,9 @@ void foo()
|
||||||
try {
|
try {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
catch(Overflow oo){
|
catch (Overflow oo){
|
||||||
}
|
}
|
||||||
catch(Matherr mm){
|
catch (Matherr mm){
|
||||||
//Test
|
//Test
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ class Foo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//Test
|
//Test
|
||||||
char & operator [](unsigned int);
|
char& operator [](unsigned int);
|
||||||
};
|
};
|
||||||
|
|
||||||
//!Commented OperatorName2
|
//!Commented OperatorName2
|
||||||
|
@ -38,7 +38,7 @@ public:
|
||||||
class Foo
|
class Foo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char & operator [](unsigned int); //Test
|
char& operator [](unsigned int); //Test
|
||||||
};
|
};
|
||||||
|
|
||||||
//!Commented ConversionName1
|
//!Commented ConversionName1
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
//%CPP
|
//%CPP
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
while(true){
|
while (true){
|
||||||
//TEST 1
|
//TEST 1
|
||||||
break; //TEST 2
|
break; //TEST 2
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ void foo()
|
||||||
//%CPP
|
//%CPP
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
while(true){
|
while (true){
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
break; /*TEST 2*/
|
break; /*TEST 2*/
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ void foo()
|
||||||
//%CPP
|
//%CPP
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
while(true){
|
while (true){
|
||||||
//TEST 1
|
//TEST 1
|
||||||
continue; //TEST 2
|
continue; //TEST 2
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ void foo()
|
||||||
//%CPP
|
//%CPP
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
while(true){
|
while (true){
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
continue; /*TEST 2*/
|
continue; /*TEST 2*/
|
||||||
}
|
}
|
||||||
|
@ -112,7 +112,7 @@ void foo()
|
||||||
do{ //TEST 2
|
do{ //TEST 2
|
||||||
continue; //TEST 3
|
continue; //TEST 3
|
||||||
//TEST 4
|
//TEST 4
|
||||||
} while(true); //TEST 5
|
} while (true); //TEST 5
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ void foo()
|
||||||
//TEST 2
|
//TEST 2
|
||||||
continue; //TEST 3
|
continue; //TEST 3
|
||||||
//TEST 4
|
//TEST 4
|
||||||
} while(true); //TEST 5
|
} while (true); //TEST 5
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ void foo()
|
||||||
do{ /*TEST 2*/
|
do{ /*TEST 2*/
|
||||||
continue; /*TEST 3*/
|
continue; /*TEST 3*/
|
||||||
/*TEST 4*/
|
/*TEST 4*/
|
||||||
} while(true); /*TEST 5*/
|
} while (true); /*TEST 5*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ void foo()
|
||||||
/*TEST 2*/
|
/*TEST 2*/
|
||||||
continue; /*TEST 3*/
|
continue; /*TEST 3*/
|
||||||
/*TEST 4*/
|
/*TEST 4*/
|
||||||
} while(true); /*TEST 5*/
|
} while (true); /*TEST 5*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@ void foo()
|
||||||
{
|
{
|
||||||
do{
|
do{
|
||||||
continue;
|
continue;
|
||||||
} while(true); /*TEST 1*/
|
} while (true); /*TEST 1*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -197,7 +197,7 @@ void foo()
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
//TEST 1
|
//TEST 1
|
||||||
for(int i = 0;i < 1;++i){ //TEST 2
|
for (int i = 0;i < 1;++i){ //TEST 2
|
||||||
break; //TEST 3
|
break; //TEST 3
|
||||||
} //TEST 4
|
} //TEST 4
|
||||||
}
|
}
|
||||||
|
@ -207,7 +207,7 @@ void foo()
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
//TEST 1
|
//TEST 1
|
||||||
for(int i = 0;i < 1;++i){
|
for (int i = 0;i < 1;++i){
|
||||||
//TEST 2
|
//TEST 2
|
||||||
break; //TEST 3
|
break; //TEST 3
|
||||||
} //TEST 4
|
} //TEST 4
|
||||||
|
@ -219,7 +219,7 @@ void foo()
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
for(int i = 0;i < 1;++i){ /*TEST 2*/
|
for (int i = 0;i < 1;++i){ /*TEST 2*/
|
||||||
break; /*TEST 3*/
|
break; /*TEST 3*/
|
||||||
} /*TEST 4*/
|
} /*TEST 4*/
|
||||||
}
|
}
|
||||||
|
@ -229,7 +229,7 @@ void foo()
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
for(int i = 0;i < 1;++i){
|
for (int i = 0;i < 1;++i){
|
||||||
/*TEST 2*/
|
/*TEST 2*/
|
||||||
break; /*TEST 3*/
|
break; /*TEST 3*/
|
||||||
} /*TEST 4*/
|
} /*TEST 4*/
|
||||||
|
@ -240,7 +240,7 @@ void foo()
|
||||||
//%CPP
|
//%CPP
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
for(int i = 0;i < 1;++i){
|
for (int i = 0;i < 1;++i){
|
||||||
break;
|
break;
|
||||||
} /*TEST 4*/
|
} /*TEST 4*/
|
||||||
}
|
}
|
||||||
|
@ -385,7 +385,7 @@ void foo()
|
||||||
//%CPP
|
//%CPP
|
||||||
int f()
|
int f()
|
||||||
{
|
{
|
||||||
if(int c = f()){
|
if (int c = f()){
|
||||||
c++;
|
c++;
|
||||||
} //TEST 1
|
} //TEST 1
|
||||||
return i;
|
return i;
|
||||||
|
@ -398,7 +398,7 @@ int f()
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
//TEST 1
|
//TEST 1
|
||||||
if(i < 1){
|
if (i < 1){
|
||||||
//TEST 3
|
//TEST 3
|
||||||
++i;
|
++i;
|
||||||
//TEST 4
|
//TEST 4
|
||||||
|
@ -407,7 +407,7 @@ int f()
|
||||||
--i;
|
--i;
|
||||||
//TEST 6
|
//TEST 6
|
||||||
} //TEST 7
|
} //TEST 7
|
||||||
if(int c = f()){
|
if (int c = f()){
|
||||||
c++;
|
c++;
|
||||||
} //TEST 8
|
} //TEST 8
|
||||||
return i;
|
return i;
|
||||||
|
@ -420,7 +420,7 @@ int f()
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
if(i < 1){
|
if (i < 1){
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
++i;
|
++i;
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
|
@ -429,7 +429,7 @@ int f()
|
||||||
--i;
|
--i;
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
} /*TEST 1*/
|
} /*TEST 1*/
|
||||||
if(int c = f()){
|
if (int c = f()){
|
||||||
c++;
|
c++;
|
||||||
} /*TEST 1*/
|
} /*TEST 1*/
|
||||||
return i;
|
return i;
|
||||||
|
@ -440,7 +440,7 @@ int f()
|
||||||
//%CPP
|
//%CPP
|
||||||
int g()
|
int g()
|
||||||
{
|
{
|
||||||
if(10 > 5) //TEST 1
|
if (10 > 5) //TEST 1
|
||||||
return 1; //TEST 2
|
return 1; //TEST 2
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -449,7 +449,7 @@ int g()
|
||||||
//=
|
//=
|
||||||
int g()
|
int g()
|
||||||
{
|
{
|
||||||
if(10 > 5)
|
if (10 > 5)
|
||||||
//TEST 1
|
//TEST 1
|
||||||
return 1; //TEST 2
|
return 1; //TEST 2
|
||||||
|
|
||||||
|
@ -460,7 +460,7 @@ int g()
|
||||||
//%CPP
|
//%CPP
|
||||||
int g()
|
int g()
|
||||||
{
|
{
|
||||||
if(10 > 5) /*TEST 1*/
|
if (10 > 5) /*TEST 1*/
|
||||||
return 1; /*TEST 2*/
|
return 1; /*TEST 2*/
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -469,7 +469,7 @@ int g()
|
||||||
//=
|
//=
|
||||||
int g()
|
int g()
|
||||||
{
|
{
|
||||||
if(10 > 5)
|
if (10 > 5)
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
return 1; /*TEST 2*/
|
return 1; /*TEST 2*/
|
||||||
|
|
||||||
|
@ -583,7 +583,7 @@ void foo()
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
//TEST 1
|
//TEST 1
|
||||||
while(true){ //TEST 2
|
while (true){ //TEST 2
|
||||||
//TEST 3
|
//TEST 3
|
||||||
break; //TEST 4
|
break; //TEST 4
|
||||||
//TEST 5
|
//TEST 5
|
||||||
|
@ -595,7 +595,7 @@ void foo()
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
//TEST 1
|
//TEST 1
|
||||||
while(true){
|
while (true){
|
||||||
//TEST 2
|
//TEST 2
|
||||||
//TEST 3
|
//TEST 3
|
||||||
break; //TEST 4
|
break; //TEST 4
|
||||||
|
@ -609,7 +609,7 @@ void foo()
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
while(true){ /*TEST 2*/
|
while (true){ /*TEST 2*/
|
||||||
/*TEST 3*/
|
/*TEST 3*/
|
||||||
break; /*TEST 4*/
|
break; /*TEST 4*/
|
||||||
/*TEST 5*/
|
/*TEST 5*/
|
||||||
|
@ -621,7 +621,7 @@ void foo()
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
while(true){
|
while (true){
|
||||||
/*TEST 2*/
|
/*TEST 2*/
|
||||||
/*TEST 3*/
|
/*TEST 3*/
|
||||||
break; /*TEST 4*/
|
break; /*TEST 4*/
|
||||||
|
@ -634,7 +634,7 @@ void foo()
|
||||||
//%CPP
|
//%CPP
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
while(true){
|
while (true){
|
||||||
break;
|
break;
|
||||||
} /*TEST 6*/
|
} /*TEST 6*/
|
||||||
}
|
}
|
||||||
|
@ -650,10 +650,10 @@ int foo()
|
||||||
++i;
|
++i;
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,7 @@
|
||||||
//!Commented TemplateFunction1
|
//!Commented TemplateFunction1
|
||||||
//%CPP
|
//%CPP
|
||||||
template<typename T> int tempFunct(T p)
|
template<typename T>
|
||||||
|
int tempFunct(T p)
|
||||||
{
|
{
|
||||||
++p;
|
++p;
|
||||||
//Kommentar
|
//Kommentar
|
||||||
|
@ -12,7 +13,8 @@ template<typename T> int tempFunct(T p)
|
||||||
//!Commented TemplateFunction2
|
//!Commented TemplateFunction2
|
||||||
//%CPP
|
//%CPP
|
||||||
//Kommentar
|
//Kommentar
|
||||||
template<typename T> int tempFunct(T p)
|
template<typename T>
|
||||||
|
int tempFunct(T p)
|
||||||
{
|
{
|
||||||
++p;
|
++p;
|
||||||
p + 4;
|
p + 4;
|
||||||
|
@ -22,7 +24,8 @@ template<typename T> int tempFunct(T p)
|
||||||
|
|
||||||
//!Commented TemplateFunction3
|
//!Commented TemplateFunction3
|
||||||
//%CPP
|
//%CPP
|
||||||
template<typename T> int tempFunct(T p)
|
template<typename T>
|
||||||
|
int tempFunct(T p)
|
||||||
{
|
{
|
||||||
++p;
|
++p;
|
||||||
p + 4;
|
p + 4;
|
||||||
|
|
|
@ -7,9 +7,10 @@ inline int foo()
|
||||||
|
|
||||||
const int a = 1;
|
const int a = 1;
|
||||||
volatile int b = 3;
|
volatile int b = 3;
|
||||||
typedef int *intp;
|
typedef int* intp;
|
||||||
extern int b;
|
extern int b;
|
||||||
static int c;
|
static int c;
|
||||||
|
|
||||||
int foo()
|
int foo()
|
||||||
{
|
{
|
||||||
int i = 1;
|
int i = 1;
|
||||||
|
@ -43,7 +44,7 @@ public:
|
||||||
|
|
||||||
//!ElaboratedTypeSpecifier
|
//!ElaboratedTypeSpecifier
|
||||||
//%CPP
|
//%CPP
|
||||||
class A *A;
|
class A* A;
|
||||||
enum Status{ good, bad};
|
enum Status{ good, bad};
|
||||||
enum Status stat;
|
enum Status stat;
|
||||||
union D
|
union D
|
||||||
|
@ -52,7 +53,7 @@ union D
|
||||||
int y;
|
int y;
|
||||||
};
|
};
|
||||||
union D d;
|
union D d;
|
||||||
struct S *S;
|
struct S* S;
|
||||||
|
|
||||||
//!EnumeratioSpecifier
|
//!EnumeratioSpecifier
|
||||||
//%CPP
|
//%CPP
|
||||||
|
|
|
@ -32,12 +32,14 @@ extern "C" typedef void FUNC();
|
||||||
|
|
||||||
//!NamespaceAlias
|
//!NamespaceAlias
|
||||||
//%CPP
|
//%CPP
|
||||||
namespace kurz = ziemlichlangernamespace;
|
namespace kurz = somenamespace;
|
||||||
|
|
||||||
//!NamespaceDefinition
|
//!NamespaceDefinition
|
||||||
//%CPP
|
//%CPP
|
||||||
namespace ziemlichlangernamespace
|
namespace somenamespace
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//!TemplateDeclaration
|
//!TemplateDeclaration
|
||||||
|
@ -58,8 +60,9 @@ template<typename T> class MyQueue;
|
||||||
template<> class MyQueue<double>
|
template<> class MyQueue<double>
|
||||||
{
|
{
|
||||||
std::vector<double> data;
|
std::vector<double> data;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Add(const double& );
|
void Add(const double&);
|
||||||
void Remove();
|
void Remove();
|
||||||
void Print();
|
void Print();
|
||||||
};
|
};
|
||||||
|
@ -92,9 +95,11 @@ using namespace B;
|
||||||
class A
|
class A
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
int hallo();
|
int hello();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int b, c;
|
int b, c;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int p;
|
int p;
|
||||||
};
|
};
|
||||||
|
@ -104,7 +109,7 @@ private:
|
||||||
//Comment
|
//Comment
|
||||||
int i = 2;
|
int i = 2;
|
||||||
|
|
||||||
//!typename qualfier
|
//!Typename qualifier
|
||||||
//%CPP
|
//%CPP
|
||||||
typename T::A *a6;
|
typename T::A* a6;
|
||||||
|
|
||||||
|
|
|
@ -1,22 +1,23 @@
|
||||||
//!DeclaratorTest
|
//!DeclaratorTest
|
||||||
//%CPP
|
//%CPP
|
||||||
int sd;
|
int sd;
|
||||||
int *ip;
|
int* ip;
|
||||||
int hs = 1;
|
int hs = 1;
|
||||||
char & c;
|
char& c;
|
||||||
|
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
struct B
|
struct B
|
||||||
{
|
{
|
||||||
int f();
|
int f();
|
||||||
};
|
};
|
||||||
int (B::* pb)() = &B::f;
|
int (B::*pb)() = &B::f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!ArrayDeclaratorTest
|
//!ArrayDeclaratorTest
|
||||||
//%CPP
|
//%CPP
|
||||||
int *pi[3];
|
int* pi[3];
|
||||||
int (*p3i)[3];
|
int (*p3i)[3];
|
||||||
|
|
||||||
//!FieldDeclaratorTest
|
//!FieldDeclaratorTest
|
||||||
|
@ -30,38 +31,39 @@ struct Bit
|
||||||
//%C
|
//%C
|
||||||
int foo();
|
int foo();
|
||||||
int bar(int a, int b);
|
int bar(int a, int b);
|
||||||
int fun(const char *a, ...);
|
int fun(const char* a, ...);
|
||||||
int fun3(int i, const char *a, ...);
|
int fun3(int i, const char* a, ...);
|
||||||
|
|
||||||
//!CPPStandardFunctionDeclaratorTest
|
//!CPPStandardFunctionDeclaratorTest
|
||||||
//%CPP
|
//%CPP
|
||||||
int foo();
|
int foo();
|
||||||
int bar(int a, int b);
|
int bar(int a, int b);
|
||||||
int fun(const char *a, ...);
|
int fun(const char* a, ...);
|
||||||
int fun2(const char *a ...);
|
int fun2(const char* a ...);
|
||||||
int fun3(int i, const char *a, ...);
|
int fun3(int i, const char* a, ...);
|
||||||
//= ,... is synonymous with ...
|
//= ,... is synonymous with ...
|
||||||
int foo();
|
int foo();
|
||||||
int bar(int a, int b);
|
int bar(int a, int b);
|
||||||
int fun(const char *a, ...);
|
int fun(const char* a, ...);
|
||||||
int fun2(const char *a, ...);
|
int fun2(const char* a, ...);
|
||||||
int fun3(int i, const char *a, ...);
|
int fun3(int i, const char* a, ...);
|
||||||
|
|
||||||
//!CPPFunctionDeclaratorTest
|
//!CPPFunctionDeclaratorTest
|
||||||
//%CPP
|
//%CPP
|
||||||
char & operator [](unsigned int);
|
char& operator [](unsigned int);
|
||||||
class TestClass
|
class TestClass
|
||||||
{
|
{
|
||||||
int alpha;
|
int alpha;
|
||||||
TestClass(int a);
|
TestClass(int a);
|
||||||
virtual void pure() =0;
|
virtual void pure() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
TestClass::TestClass(int a)
|
TestClass::TestClass(int a)
|
||||||
:alpha(a)
|
:alpha(a)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void undefPar(const char *c) throw (int);
|
void undefPar(const char* c) throw (int);
|
||||||
int getV() const;
|
int getV() const;
|
||||||
int vol() volatile;
|
int vol() volatile;
|
||||||
|
|
||||||
|
@ -72,15 +74,17 @@ class C
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
double d;
|
double d;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
C(int, double);
|
C(int, double);
|
||||||
};
|
};
|
||||||
|
|
||||||
C::C(int ii, double id)
|
C::C(int ii, double id)
|
||||||
try
|
try
|
||||||
:i(f(ii)), d(id)
|
:i(f(ii)), d(id)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -94,7 +98,7 @@ int b, a;
|
||||||
|
|
||||||
//!ICPPASTDeclarator with nested declarator being a variable
|
//!ICPPASTDeclarator with nested declarator being a variable
|
||||||
//%C
|
//%C
|
||||||
int *(*var[3]);
|
int* (*var[3]);
|
||||||
|
|
||||||
//!ICPPASTDeclarator with nested declarator and redundant parentheses
|
//!ICPPASTDeclarator with nested declarator and redundant parentheses
|
||||||
//%C
|
//%C
|
||||||
|
@ -108,8 +112,8 @@ class Foo
|
||||||
};
|
};
|
||||||
//!ICPPASTReferenceOperator rvalue reference
|
//!ICPPASTReferenceOperator rvalue reference
|
||||||
//%CPP
|
//%CPP
|
||||||
int && foo(int && a)
|
int&& foo(int&& a)
|
||||||
{
|
{
|
||||||
char && b;
|
char&& b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,10 +4,10 @@ int i = (int)'A';
|
||||||
|
|
||||||
//!CPPCastExpression
|
//!CPPCastExpression
|
||||||
//%CPP
|
//%CPP
|
||||||
TestClass *i = dynamic_cast<TestClass*>(tc);
|
TestClass* i = dynamic_cast<TestClass*>(tc);
|
||||||
TestClass *i = static_cast<TestClass*>(tc);
|
TestClass* i = static_cast<TestClass*>(tc);
|
||||||
TestClass *i = reinterpret_cast<TestClass*>(tc);
|
TestClass* i = reinterpret_cast<TestClass*>(tc);
|
||||||
TestClass *i = const_cast<TestClass*>(tc);
|
TestClass* i = const_cast<TestClass*>(tc);
|
||||||
|
|
||||||
//!ArraySubscrition
|
//!ArraySubscrition
|
||||||
//%C GNU
|
//%C GNU
|
||||||
|
@ -33,6 +33,7 @@ int i = 1 | x;
|
||||||
bool b = 1 && x;
|
bool b = 1 && x;
|
||||||
bool b = 1 || x;
|
bool b = 1 || x;
|
||||||
int i = x;
|
int i = x;
|
||||||
|
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
i *= x;
|
i *= x;
|
||||||
|
@ -131,7 +132,7 @@ string s = "abc";
|
||||||
|
|
||||||
//!CPPLiteralExpression
|
//!CPPLiteralExpression
|
||||||
//%CPP
|
//%CPP
|
||||||
TestClass *tc = this;
|
TestClass* tc = this;
|
||||||
bool b = true;
|
bool b = true;
|
||||||
bool b = false;
|
bool b = false;
|
||||||
|
|
||||||
|
@ -141,7 +142,7 @@ int i = ++a;
|
||||||
int i = --a;
|
int i = --a;
|
||||||
int i = +a;
|
int i = +a;
|
||||||
int i = -a;
|
int i = -a;
|
||||||
int *b = &a;
|
int* b = &a;
|
||||||
int i = *b;
|
int i = *b;
|
||||||
int i = ~b;
|
int i = ~b;
|
||||||
bool b = !false;
|
bool b = !false;
|
||||||
|
@ -167,7 +168,7 @@ void rethrow()
|
||||||
int i = 1;
|
int i = 1;
|
||||||
throw i;
|
throw i;
|
||||||
}
|
}
|
||||||
catch(int j){
|
catch (int j){
|
||||||
throw ;
|
throw ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -191,7 +192,7 @@ void f()
|
||||||
|
|
||||||
//!CPPNewExpression
|
//!CPPNewExpression
|
||||||
//%CPP
|
//%CPP
|
||||||
TestClass *tc = new TestClass();
|
TestClass* tc = new TestClass();
|
||||||
|
|
||||||
//!CPPSimpleTypeConstructorExpression
|
//!CPPSimpleTypeConstructorExpression
|
||||||
//%CPP
|
//%CPP
|
||||||
|
|
|
@ -11,7 +11,7 @@ int TestClass::Hallo;
|
||||||
class Foo
|
class Foo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char & operator [](unsigned int);
|
char& operator [](unsigned int);
|
||||||
};
|
};
|
||||||
|
|
||||||
//!ConversionName
|
//!ConversionName
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
//%CPP
|
//%CPP
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
while(true){
|
while (true){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ void foo()
|
||||||
//%CPP
|
//%CPP
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
while(true){
|
while (true){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ void foo()
|
||||||
{
|
{
|
||||||
do{
|
do{
|
||||||
continue;
|
continue;
|
||||||
} while(true);
|
} while (true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -79,13 +79,13 @@ void foo()
|
||||||
//%CPP
|
//%CPP
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
for(int i = 0;i < 1;++i){
|
for (int i = 0;i < 1;++i){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
for(;;){
|
for (;;){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
for(;int c = f();){
|
for (;int c = f();){
|
||||||
c++;
|
c++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ void foo()
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for(i = 0;i < 1;++i){
|
for (i = 0;i < 1;++i){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,12 +115,12 @@ int f()
|
||||||
int f()
|
int f()
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
if(i < 1){
|
if (i < 1){
|
||||||
++i;
|
++i;
|
||||||
}else{
|
}else{
|
||||||
--i;
|
--i;
|
||||||
}
|
}
|
||||||
if(int c = f()){
|
if (int c = f()){
|
||||||
c++;
|
c++;
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
|
@ -131,7 +131,7 @@ int f()
|
||||||
//%CPP
|
//%CPP
|
||||||
int g()
|
int g()
|
||||||
{
|
{
|
||||||
if(10 > 5)
|
if (10 > 5)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -141,7 +141,7 @@ int g()
|
||||||
//%C
|
//%C
|
||||||
int g()
|
int g()
|
||||||
{
|
{
|
||||||
if(10 > 5)
|
if (10 > 5)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -240,14 +240,14 @@ int foo(int a)
|
||||||
//%CPP
|
//%CPP
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
while(true){
|
while (true){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void fa()
|
void fa()
|
||||||
{
|
{
|
||||||
while(int i = f()){
|
while (int i = f()){
|
||||||
++i;
|
++i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -255,7 +255,7 @@ void fa()
|
||||||
|
|
||||||
void fb()
|
void fb()
|
||||||
{
|
{
|
||||||
while(true);
|
while (true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -263,7 +263,7 @@ void fb()
|
||||||
//%C
|
//%C
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
while(true){
|
while (true){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -279,10 +279,10 @@ int foo()
|
||||||
++i;
|
++i;
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -293,7 +293,7 @@ int foo()
|
||||||
int foo()
|
int foo()
|
||||||
{
|
{
|
||||||
int i = 1;
|
int i = 1;
|
||||||
if( i == ZWO)
|
if (i == ZWO)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -301,7 +301,7 @@ int foo()
|
||||||
int foo()
|
int foo()
|
||||||
{
|
{
|
||||||
int i = 1;
|
int i = 1;
|
||||||
if( i == ZWO)
|
if (i == ZWO)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -309,5 +309,5 @@ int foo()
|
||||||
|
|
||||||
//!ArrayDeclarationStatementTest
|
//!ArrayDeclarationStatementTest
|
||||||
//%CPP
|
//%CPP
|
||||||
string *newElements = new string[m_capacity];
|
string* newElements = new string[m_capacity];
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
//![temp.names] examples abschnitt 4/1
|
//![temp.names] examples abschnitt 4/1
|
||||||
//%CPP
|
//%CPP
|
||||||
T *p1 = p->template alloc<100>();
|
T* p1 = p->template alloc<100>();
|
||||||
|
|
||||||
//![temp.names] examples abschnitt 4/2, didn't work cause of Bug# 164482
|
//![temp.names] examples abschnitt 4/2, didn't work cause of Bug# 164482
|
||||||
//%CPP
|
//%CPP
|
||||||
template<class T> void f(T *p)
|
template<class T>
|
||||||
|
void f(T* p)
|
||||||
{
|
{
|
||||||
T::template adjust<100>();
|
T::template adjust<100>();
|
||||||
}
|
}
|
||||||
|
|
|
@ -148,6 +148,7 @@ class Klasse0
|
||||||
public:
|
public:
|
||||||
Klasse0(); //Comment
|
Klasse0(); //Comment
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
};
|
};
|
||||||
|
@ -170,6 +171,7 @@ class Klasse0
|
||||||
public:
|
public:
|
||||||
Klasse1();
|
Klasse1();
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
};
|
};
|
||||||
|
@ -182,6 +184,7 @@ class Klasse0
|
||||||
public:
|
public:
|
||||||
Klasse1();
|
Klasse1();
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
}; = //Comment1
|
}; = //Comment1
|
||||||
|
@ -2779,26 +2782,26 @@ int foo = bar; = //Zweiteilig
|
||||||
//#org.eclipse.cdt.core.parser.tests.rewrite.comenthandler.CommentHandlingTest
|
//#org.eclipse.cdt.core.parser.tests.rewrite.comenthandler.CommentHandlingTest
|
||||||
//@Klasse1.h
|
//@Klasse1.h
|
||||||
//TEST 1
|
//TEST 1
|
||||||
namespace ziemlichlangernamespace
|
namespace somenamespace
|
||||||
{
|
{
|
||||||
//TEST 2
|
//TEST 2
|
||||||
} //TEST 3
|
} //TEST 3
|
||||||
|
|
||||||
//=
|
//=
|
||||||
=>leading
|
=>leading
|
||||||
namespace ziemlichlangernamespace
|
namespace somenamespace
|
||||||
{
|
{
|
||||||
//TEST 2
|
//TEST 2
|
||||||
} = //TEST 1
|
} = //TEST 1
|
||||||
|
|
||||||
=>trailing
|
=>trailing
|
||||||
namespace ziemlichlangernamespace
|
namespace somenamespace
|
||||||
{
|
{
|
||||||
//TEST 2
|
//TEST 2
|
||||||
} = //TEST 3
|
} = //TEST 3
|
||||||
|
|
||||||
=>freestanding
|
=>freestanding
|
||||||
namespace ziemlichlangernamespace
|
namespace somenamespace
|
||||||
{
|
{
|
||||||
//TEST 2
|
//TEST 2
|
||||||
} = //TEST 2
|
} = //TEST 2
|
||||||
|
@ -2807,7 +2810,7 @@ namespace ziemlichlangernamespace
|
||||||
//!CommentRecognition215 - von ASTWriter NamesapceDefinition
|
//!CommentRecognition215 - von ASTWriter NamesapceDefinition
|
||||||
//#org.eclipse.cdt.core.parser.tests.rewrite.comenthandler.CommentHandlingTest
|
//#org.eclipse.cdt.core.parser.tests.rewrite.comenthandler.CommentHandlingTest
|
||||||
//@Klasse1.h
|
//@Klasse1.h
|
||||||
namespace ziemlichlangernamespace
|
namespace somenamespace
|
||||||
{
|
{
|
||||||
//TEST
|
//TEST
|
||||||
}
|
}
|
||||||
|
@ -2822,7 +2825,7 @@ void doIt(){
|
||||||
=>trailing
|
=>trailing
|
||||||
|
|
||||||
=>freestanding
|
=>freestanding
|
||||||
namespace ziemlichlangernamespace
|
namespace somenamespace
|
||||||
{
|
{
|
||||||
//TEST
|
//TEST
|
||||||
} = //TEST
|
} = //TEST
|
||||||
|
@ -2830,7 +2833,7 @@ namespace ziemlichlangernamespace
|
||||||
//!CommentRecognition216 - von ASTWriter NamesapceDefinition
|
//!CommentRecognition216 - von ASTWriter NamesapceDefinition
|
||||||
//#org.eclipse.cdt.core.parser.tests.rewrite.comenthandler.CommentHandlingTest
|
//#org.eclipse.cdt.core.parser.tests.rewrite.comenthandler.CommentHandlingTest
|
||||||
//@Klasse1.h
|
//@Klasse1.h
|
||||||
namespace ziemlichlangernamespace
|
namespace somenamespace
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
//TEST
|
//TEST
|
||||||
|
@ -2846,7 +2849,7 @@ void doIt(){
|
||||||
=>trailing
|
=>trailing
|
||||||
|
|
||||||
=>freestanding
|
=>freestanding
|
||||||
namespace ziemlichlangernamespace
|
namespace somenamespace
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
//TEST
|
//TEST
|
||||||
|
|
|
@ -8,10 +8,19 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Institute for Software - initial API and implementation
|
* Institute for Software - initial API and implementation
|
||||||
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.rewrite.astwriter;
|
package org.eclipse.cdt.internal.core.dom.rewrite.astwriter;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTASMDeclaration;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTIfStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTStatement;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceDefinition;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateDeclaration;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVisibilityLabel;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.changegenerator.ChangeGeneratorWriterVisitor;
|
import org.eclipse.cdt.internal.core.dom.rewrite.changegenerator.ChangeGeneratorWriterVisitor;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.ASTCommenter;
|
import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.ASTCommenter;
|
||||||
|
@ -19,9 +28,7 @@ import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.NodeCommentMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ASTWriter main class. Generates source code from <code>IASTNode</code>.
|
* ASTWriter main class. Generates source code from <code>IASTNode</code>.
|
||||||
* Uses a <code>hangeGeneratorWriterVisitor</code> to generate the code for the given nodes.
|
* Uses a {@link ChangeGeneratorWriterVisitor} to generate the code for the given nodes.
|
||||||
*
|
|
||||||
* @see ChangeGeneratorWriterVisitor
|
|
||||||
*
|
*
|
||||||
* @author Emanuel Graf
|
* @author Emanuel Graf
|
||||||
*/
|
*/
|
||||||
|
@ -54,18 +61,13 @@ public class ASTWriter {
|
||||||
* @throws ProblemRuntimeException if the node or one of it's children is a <code>IASTProblemNode</code>.
|
* @throws ProblemRuntimeException if the node or one of it's children is a <code>IASTProblemNode</code>.
|
||||||
*/
|
*/
|
||||||
public String write(IASTNode rootNode) throws ProblemRuntimeException {
|
public String write(IASTNode rootNode) throws ProblemRuntimeException {
|
||||||
return write(rootNode, null, new NodeCommentMap());
|
return write(rootNode, new NodeCommentMap());
|
||||||
}
|
|
||||||
|
|
||||||
public String write(IASTNode rootNode, NodeCommentMap commentMap) {
|
|
||||||
return write(rootNode, null, commentMap);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates the source code representing this node including comments.
|
* Generates the source code representing this node including comments.
|
||||||
*
|
*
|
||||||
* @param rootNode Node to write.
|
* @param rootNode Node to write.
|
||||||
* @param fileScope
|
|
||||||
* @param commentMap Node Comment Map <code>ASTCommenter</code>
|
* @param commentMap Node Comment Map <code>ASTCommenter</code>
|
||||||
* @return A <code>String</code> representing the source code for the node.
|
* @return A <code>String</code> representing the source code for the node.
|
||||||
* @throws ProblemRuntimeException if the node or one of it's children is
|
* @throws ProblemRuntimeException if the node or one of it's children is
|
||||||
|
@ -73,17 +75,95 @@ public class ASTWriter {
|
||||||
*
|
*
|
||||||
* @see ASTCommenter#getCommentedNodeMap(org.eclipse.cdt.core.dom.ast.IASTTranslationUnit)
|
* @see ASTCommenter#getCommentedNodeMap(org.eclipse.cdt.core.dom.ast.IASTTranslationUnit)
|
||||||
*/
|
*/
|
||||||
public String write(IASTNode rootNode, String fileScope, NodeCommentMap commentMap)
|
public String write(IASTNode rootNode, NodeCommentMap commentMap)
|
||||||
throws ProblemRuntimeException {
|
throws ProblemRuntimeException {
|
||||||
ChangeGeneratorWriterVisitor transformationVisitor = new ChangeGeneratorWriterVisitor(
|
ChangeGeneratorWriterVisitor writer = new ChangeGeneratorWriterVisitor(
|
||||||
modificationStore, givenIndentation, fileScope, commentMap);
|
modificationStore, givenIndentation, null, commentMap);
|
||||||
if (rootNode != null) {
|
if (rootNode != null) {
|
||||||
rootNode.accept(transformationVisitor);
|
rootNode.accept(writer);
|
||||||
}
|
}
|
||||||
return transformationVisitor.toString();
|
return writer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setModificationStore(ASTModificationStore modificationStore) {
|
public void setModificationStore(ASTModificationStore modificationStore) {
|
||||||
this.modificationStore = modificationStore;
|
this.modificationStore = modificationStore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns <code>true</code> if the node should be separated by a blank line from the node
|
||||||
|
* before it.
|
||||||
|
*
|
||||||
|
* @param node The node.
|
||||||
|
* @return <code>true</code> if the node should be separated by a blank line from the node
|
||||||
|
* before it.
|
||||||
|
*/
|
||||||
|
public static boolean requiresLeadingBlankLine(IASTNode node) {
|
||||||
|
if (node instanceof ICPPASTTemplateDeclaration) {
|
||||||
|
node = ((ICPPASTTemplateDeclaration) node).getDeclaration();
|
||||||
|
}
|
||||||
|
return node instanceof IASTASMDeclaration ||
|
||||||
|
node instanceof IASTFunctionDefinition ||
|
||||||
|
node instanceof ICPPASTVisibilityLabel;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns <code>true</code> if the node should be separated by a blank line from the node
|
||||||
|
* after it.
|
||||||
|
*
|
||||||
|
* @param node The node.
|
||||||
|
* @return <code>true</code> if the node should be separated by a blank line from the node
|
||||||
|
* after it.
|
||||||
|
*/
|
||||||
|
public static boolean requiresTrailingBlankLine(IASTNode node) {
|
||||||
|
if (node instanceof ICPPASTNamespaceDefinition)
|
||||||
|
return true;
|
||||||
|
if (node instanceof IASTFunctionDefinition)
|
||||||
|
return true;
|
||||||
|
if (node instanceof IASTIfStatement) {
|
||||||
|
IASTIfStatement statement = ((IASTIfStatement) node);
|
||||||
|
IASTStatement lastClause = statement.getElseClause();
|
||||||
|
if (lastClause == null)
|
||||||
|
lastClause = statement.getThenClause();
|
||||||
|
|
||||||
|
if (!(lastClause instanceof IASTCompoundStatement) &&
|
||||||
|
!doNodesHaveSameOffset(lastClause, statement)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns <code>true</code> if there should be no blank line after this node even if a blank
|
||||||
|
* line is normally required before the subsequent node.
|
||||||
|
*
|
||||||
|
* @param node The node.
|
||||||
|
* @return <code>true</code> if there should be no blank line after this node.
|
||||||
|
*/
|
||||||
|
public static boolean suppressesTrailingBlankLine(IASTNode node) {
|
||||||
|
return node instanceof ICPPASTVisibilityLabel;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns <code>true</code> if the two given nodes should be separated by a blank line.
|
||||||
|
*
|
||||||
|
* @param node1 The first node.
|
||||||
|
* @param node2 The second node.
|
||||||
|
* @return <code>true</code> if the blank line between the nodes is needed.
|
||||||
|
*/
|
||||||
|
public static boolean requireBlankLineInBetween(IASTNode node1, IASTNode node2) {
|
||||||
|
if (requiresTrailingBlankLine(node1))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return !suppressesTrailingBlankLine(node1) && requiresLeadingBlankLine(node2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the two given nodes have the same offset. For nodes that are normally
|
||||||
|
* separated by other tokens this is an indication that they were produced by the same macro
|
||||||
|
* expansion.
|
||||||
|
*/
|
||||||
|
private static boolean doNodesHaveSameOffset(IASTNode node1, IASTNode node2) {
|
||||||
|
return node1.getFileLocation().getNodeOffset() == node2.getFileLocation().getNodeOffset();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Institute for Software - initial API and implementation
|
* Institute for Software - initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.rewrite.astwriter;
|
package org.eclipse.cdt.internal.core.dom.rewrite.astwriter;
|
||||||
|
|
||||||
|
@ -38,15 +39,14 @@ import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.NodeCommentMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Visits all nodes, prints leading comments and handles macro expansions. The
|
* Visits all nodes, prints leading comments and handles macro expansions. The
|
||||||
* source code generation is delegated to severals <code>NodeWriters</code>.
|
* source code generation is delegated to severals {@code NodeWriter}s.
|
||||||
*
|
*
|
||||||
* @see NodeWriter
|
|
||||||
* @see MacroExpansionHandler
|
* @see MacroExpansionHandler
|
||||||
*
|
*
|
||||||
* @author Emanuel Graf IFS
|
* @author Emanuel Graf IFS
|
||||||
*/
|
*/
|
||||||
public class ASTWriterVisitor extends ASTVisitor {
|
public class ASTWriterVisitor extends ASTVisitor {
|
||||||
protected Scribe scribe = new Scribe();
|
protected final Scribe scribe = new Scribe();
|
||||||
protected NodeCommentMap commentMap;
|
protected NodeCommentMap commentMap;
|
||||||
protected ExpressionWriter expWriter;
|
protected ExpressionWriter expWriter;
|
||||||
protected DeclSpecWriter declSpecWriter;
|
protected DeclSpecWriter declSpecWriter;
|
||||||
|
@ -57,6 +57,9 @@ public class ASTWriterVisitor extends ASTVisitor {
|
||||||
protected NameWriter nameWriter;
|
protected NameWriter nameWriter;
|
||||||
protected TemplateParameterWriter tempParameterWriter;
|
protected TemplateParameterWriter tempParameterWriter;
|
||||||
protected MacroExpansionHandler macroHandler;
|
protected MacroExpansionHandler macroHandler;
|
||||||
|
private boolean insertLeadingBlankLine;
|
||||||
|
private boolean suppressLeadingBlankLine;
|
||||||
|
private boolean spaceNeededBeforeName;
|
||||||
|
|
||||||
{
|
{
|
||||||
shouldVisitExpressions = true;
|
shouldVisitExpressions = true;
|
||||||
|
@ -83,6 +86,7 @@ public class ASTWriterVisitor extends ASTVisitor {
|
||||||
scribe.setGivenIndentation(givenIndentation);
|
scribe.setGivenIndentation(givenIndentation);
|
||||||
init(commentMap);
|
init(commentMap);
|
||||||
this.commentMap = commentMap;
|
this.commentMap = commentMap;
|
||||||
|
this.suppressLeadingBlankLine = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void init(NodeCommentMap commentMap) {
|
private void init(NodeCommentMap commentMap) {
|
||||||
|
@ -135,6 +139,10 @@ public class ASTWriterVisitor extends ASTVisitor {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int visit(IASTName name) {
|
public int visit(IASTName name) {
|
||||||
|
if (spaceNeededBeforeName && name.getSimpleID().length != 0) {
|
||||||
|
scribe.printSpace();
|
||||||
|
spaceNeededBeforeName = false;
|
||||||
|
}
|
||||||
writeLeadingComments(name);
|
writeLeadingComments(name);
|
||||||
if (!macroHandler.checkisMacroExpansionNode(name)) {
|
if (!macroHandler.checkisMacroExpansionNode(name)) {
|
||||||
nameWriter.writeName(name);
|
nameWriter.writeName(name);
|
||||||
|
@ -166,7 +174,9 @@ public class ASTWriterVisitor extends ASTVisitor {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int visit(IASTStatement statement) {
|
public int visit(IASTStatement statement) {
|
||||||
|
insertBlankLineIfNeeded(statement);
|
||||||
writeLeadingComments(statement);
|
writeLeadingComments(statement);
|
||||||
|
try {
|
||||||
if (macroHandler.isStatementWithMixedLocation(statement) &&
|
if (macroHandler.isStatementWithMixedLocation(statement) &&
|
||||||
!(statement instanceof IASTCompoundStatement)) {
|
!(statement instanceof IASTCompoundStatement)) {
|
||||||
return statementWriter.writeMixedStatement(statement);
|
return statementWriter.writeMixedStatement(statement);
|
||||||
|
@ -175,13 +185,18 @@ public class ASTWriterVisitor extends ASTVisitor {
|
||||||
return ASTVisitor.PROCESS_SKIP;
|
return ASTVisitor.PROCESS_SKIP;
|
||||||
}
|
}
|
||||||
return statementWriter.writeStatement(statement, true);
|
return statementWriter.writeStatement(statement, true);
|
||||||
|
} finally {
|
||||||
|
setLeadingBlankLineFlags(statement);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int visit(IASTDeclaration declaration) {
|
public int visit(IASTDeclaration declaration) {
|
||||||
|
insertBlankLineIfNeeded(declaration);
|
||||||
writeLeadingComments(declaration);
|
writeLeadingComments(declaration);
|
||||||
if (!macroHandler.checkisMacroExpansionNode(declaration)) {
|
if (!macroHandler.checkisMacroExpansionNode(declaration)) {
|
||||||
declarationWriter.writeDeclaration(declaration);
|
declarationWriter.writeDeclaration(declaration);
|
||||||
|
setLeadingBlankLineFlags(declaration);
|
||||||
}
|
}
|
||||||
return ASTVisitor.PROCESS_SKIP;
|
return ASTVisitor.PROCESS_SKIP;
|
||||||
}
|
}
|
||||||
|
@ -219,9 +234,7 @@ public class ASTWriterVisitor extends ASTVisitor {
|
||||||
parameterDeclaration.getDeclSpecifier().accept(this);
|
parameterDeclaration.getDeclSpecifier().accept(this);
|
||||||
IASTDeclarator declarator = getParameterDeclarator(parameterDeclaration);
|
IASTDeclarator declarator = getParameterDeclarator(parameterDeclaration);
|
||||||
|
|
||||||
if (getParameterName(declarator).toString().length() != 0) {
|
spaceNeededBeforeName = true;
|
||||||
scribe.printSpaces(1);
|
|
||||||
}
|
|
||||||
declarator.accept(this);
|
declarator.accept(this);
|
||||||
}
|
}
|
||||||
return ASTVisitor.PROCESS_SKIP;
|
return ASTVisitor.PROCESS_SKIP;
|
||||||
|
@ -237,9 +250,11 @@ public class ASTWriterVisitor extends ASTVisitor {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int visit(ICPPASTNamespaceDefinition namespace) {
|
public int visit(ICPPASTNamespaceDefinition namespace) {
|
||||||
|
insertBlankLineIfNeeded(namespace);
|
||||||
writeLeadingComments(namespace);
|
writeLeadingComments(namespace);
|
||||||
if (!macroHandler.checkisMacroExpansionNode(namespace)) {
|
if (!macroHandler.checkisMacroExpansionNode(namespace)) {
|
||||||
declarationWriter.writeDeclaration(namespace);
|
declarationWriter.writeDeclaration(namespace);
|
||||||
|
setLeadingBlankLineFlags(namespace);
|
||||||
}
|
}
|
||||||
return ASTVisitor.PROCESS_SKIP;
|
return ASTVisitor.PROCESS_SKIP;
|
||||||
}
|
}
|
||||||
|
@ -257,4 +272,38 @@ public class ASTWriterVisitor extends ASTVisitor {
|
||||||
scribe.cleanCache();
|
scribe.cleanCache();
|
||||||
macroHandler.reset();
|
macroHandler.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void insertBlankLineIfNeeded(IASTNode node) {
|
||||||
|
if (!suppressLeadingBlankLine &&
|
||||||
|
(insertLeadingBlankLine || ASTWriter.requiresLeadingBlankLine(node))) {
|
||||||
|
scribe.newLine();
|
||||||
|
}
|
||||||
|
insertLeadingBlankLine = false;
|
||||||
|
suppressLeadingBlankLine = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setLeadingBlankLineFlags(IASTNode node) {
|
||||||
|
insertLeadingBlankLine = ASTWriter.requiresTrailingBlankLine(node);
|
||||||
|
suppressLeadingBlankLine = ASTWriter.suppressesTrailingBlankLine(node);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSuppressLeadingBlankLine() {
|
||||||
|
return suppressLeadingBlankLine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSuppressLeadingBlankLine(boolean value) {
|
||||||
|
this.suppressLeadingBlankLine = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSpaceNeededBeforeName() {
|
||||||
|
return spaceNeededBeforeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpaceNeededBeforeName(boolean value) {
|
||||||
|
this.spaceNeededBeforeName = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void newLine() {
|
||||||
|
scribe.newLine();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.rewrite.astwriter;
|
package org.eclipse.cdt.internal.core.dom.rewrite.astwriter;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
||||||
|
@ -62,12 +61,12 @@ public class DeclSpecWriter extends NodeWriter {
|
||||||
private static final String ENUM = "enum "; //$NON-NLS-1$
|
private static final String ENUM = "enum "; //$NON-NLS-1$
|
||||||
private static final String _BOOL = "_Bool"; //$NON-NLS-1$
|
private static final String _BOOL = "_Bool"; //$NON-NLS-1$
|
||||||
|
|
||||||
public DeclSpecWriter(Scribe scribe, ASTVisitor visitor, NodeCommentMap commentMap) {
|
public DeclSpecWriter(Scribe scribe, ASTWriterVisitor visitor, NodeCommentMap commentMap) {
|
||||||
super(scribe, visitor, commentMap);
|
super(scribe, visitor, commentMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void writeDelcSpec(IASTDeclSpecifier declSpec) {
|
protected void writeDelcSpec(IASTDeclSpecifier declSpec) {
|
||||||
// Write general DelcSpec Keywords
|
// Write general DelcSpec Keywords
|
||||||
writeDeclSpec(declSpec);
|
writeDeclSpec(declSpec);
|
||||||
if (declSpec instanceof ICPPASTDeclSpecifier) {
|
if (declSpec instanceof ICPPASTDeclSpecifier) {
|
||||||
writeCPPDeclSpec((ICPPASTDeclSpecifier) declSpec);
|
writeCPPDeclSpec((ICPPASTDeclSpecifier) declSpec);
|
||||||
|
@ -129,7 +128,6 @@ public class DeclSpecWriter extends NodeWriter {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
System.err.println("Unknown specifier type: " + type); //$NON-NLS-1$
|
|
||||||
throw new IllegalArgumentException("Unknown specifier type: " + type); //$NON-NLS-1$
|
throw new IllegalArgumentException("Unknown specifier type: " + type); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,7 +150,7 @@ public class DeclSpecWriter extends NodeWriter {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void writeNamedTypeSpecifier(ICPPASTNamedTypeSpecifier namedSpc) {
|
private void writeNamedTypeSpecifier(ICPPASTNamedTypeSpecifier namedSpc) {
|
||||||
if ( namedSpc.isTypename() ){
|
if (namedSpc.isTypename()) {
|
||||||
scribe.print(TYPENAME);
|
scribe.print(TYPENAME);
|
||||||
}
|
}
|
||||||
namedSpc.getName().accept(visitor);
|
namedSpc.getName().accept(visitor);
|
||||||
|
@ -179,8 +177,7 @@ public class DeclSpecWriter extends NodeWriter {
|
||||||
return CLASS_SPACE;
|
return CLASS_SPACE;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
System.err.println("Unknown ElaboratedType: " + kind); //$NON-NLS-1$
|
throw new IllegalArgumentException("Unknown elaborated type: " + kind); //$NON-NLS-1$
|
||||||
throw new IllegalArgumentException("Unknown ElaboratedType: " + kind); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,12 +251,13 @@ public class DeclSpecWriter extends NodeWriter {
|
||||||
hasTrailingComments = hasTrailingComments(baseSpecifiers[baseSpecifiers.length-1].getName());
|
hasTrailingComments = hasTrailingComments(baseSpecifiers[baseSpecifiers.length-1].getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!hasTrailingComments){
|
if (!hasTrailingComments) {
|
||||||
scribe.newLine();
|
scribe.newLine();
|
||||||
}
|
}
|
||||||
scribe.print('{');
|
scribe.print('{');
|
||||||
scribe.newLine();
|
scribe.newLine();
|
||||||
scribe.incrementIndentationLevel();
|
scribe.incrementIndentationLevel();
|
||||||
|
visitor.setSuppressLeadingBlankLine(true);
|
||||||
IASTDeclaration[] decls = getMembers(compDeclSpec);
|
IASTDeclaration[] decls = getMembers(compDeclSpec);
|
||||||
|
|
||||||
if (decls.length > 0) {
|
if (decls.length > 0) {
|
||||||
|
@ -306,8 +304,7 @@ public class DeclSpecWriter extends NodeWriter {
|
||||||
case ICPPASTCompositeTypeSpecifier.k_class:
|
case ICPPASTCompositeTypeSpecifier.k_class:
|
||||||
return CLASS;
|
return CLASS;
|
||||||
default:
|
default:
|
||||||
System.err.println("Unknow Specifiertype: " + key); //$NON-NLS-1$
|
throw new IllegalArgumentException("Unknown type specifier: " + key); //$NON-NLS-1$
|
||||||
throw new IllegalArgumentException("Unknow Specifiertype: " + key); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -318,8 +315,7 @@ public class DeclSpecWriter extends NodeWriter {
|
||||||
case IASTCompositeTypeSpecifier.k_union:
|
case IASTCompositeTypeSpecifier.k_union:
|
||||||
return UNION;
|
return UNION;
|
||||||
default:
|
default:
|
||||||
System.err.println("Unknow Specifiertype: " + key); //$NON-NLS-1$
|
throw new IllegalArgumentException("Unknown type specifier: " + key); //$NON-NLS-1$
|
||||||
throw new IllegalArgumentException("Unknow Specifiertype: " + key); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -368,7 +364,7 @@ public class DeclSpecWriter extends NodeWriter {
|
||||||
private void printQualifiers(IASTSimpleDeclSpecifier simpDeclSpec) {
|
private void printQualifiers(IASTSimpleDeclSpecifier simpDeclSpec) {
|
||||||
if (simpDeclSpec.isSigned()) {
|
if (simpDeclSpec.isSigned()) {
|
||||||
scribe.printStringSpace(SIGNED);
|
scribe.printStringSpace(SIGNED);
|
||||||
} else if (simpDeclSpec.isUnsigned()){
|
} else if (simpDeclSpec.isUnsigned()) {
|
||||||
scribe.printStringSpace(UNSIGNED);
|
scribe.printStringSpace(UNSIGNED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,10 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Institute for Software - initial API and implementation
|
* Institute for Software - initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.rewrite.astwriter;
|
package org.eclipse.cdt.internal.core.dom.rewrite.astwriter;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTASMDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTASMDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
||||||
|
@ -47,7 +47,7 @@ import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.NodeCommentMap;
|
||||||
* @see IASTDeclaration
|
* @see IASTDeclaration
|
||||||
* @author Emanuel Graf IFS
|
* @author Emanuel Graf IFS
|
||||||
*/
|
*/
|
||||||
public class DeclarationWriter extends NodeWriter{
|
public class DeclarationWriter extends NodeWriter {
|
||||||
private static final String ASM_END = ")"; //$NON-NLS-1$
|
private static final String ASM_END = ")"; //$NON-NLS-1$
|
||||||
private static final String ASM_START = "asm("; //$NON-NLS-1$
|
private static final String ASM_START = "asm("; //$NON-NLS-1$
|
||||||
private static final String TEMPLATE_DECLARATION = "template<"; //$NON-NLS-1$
|
private static final String TEMPLATE_DECLARATION = "template<"; //$NON-NLS-1$
|
||||||
|
@ -57,7 +57,7 @@ public class DeclarationWriter extends NodeWriter{
|
||||||
private static final String USING = "using "; //$NON-NLS-1$
|
private static final String USING = "using "; //$NON-NLS-1$
|
||||||
private boolean printSemicolon;
|
private boolean printSemicolon;
|
||||||
|
|
||||||
public DeclarationWriter(Scribe scribe, ASTVisitor visitor, NodeCommentMap commentMap) {
|
public DeclarationWriter(Scribe scribe, ASTWriterVisitor visitor, NodeCommentMap commentMap) {
|
||||||
super(scribe, visitor, commentMap);
|
super(scribe, visitor, commentMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,6 +72,7 @@ public class DeclarationWriter extends NodeWriter{
|
||||||
writeASMDeclatation((IASTASMDeclaration) declaration);
|
writeASMDeclatation((IASTASMDeclaration) declaration);
|
||||||
} else if (declaration instanceof IASTFunctionDefinition) {
|
} else if (declaration instanceof IASTFunctionDefinition) {
|
||||||
writeFunctionDefinition((IASTFunctionDefinition) declaration);
|
writeFunctionDefinition((IASTFunctionDefinition) declaration);
|
||||||
|
addNewLine = false;
|
||||||
} else if (declaration instanceof IASTProblemDeclaration) {
|
} else if (declaration instanceof IASTProblemDeclaration) {
|
||||||
throw new ProblemRuntimeException((IASTProblemDeclaration) declaration);
|
throw new ProblemRuntimeException((IASTProblemDeclaration) declaration);
|
||||||
} else if (declaration instanceof IASTSimpleDeclaration) {
|
} else if (declaration instanceof IASTSimpleDeclaration) {
|
||||||
|
@ -98,17 +99,17 @@ public class DeclarationWriter extends NodeWriter{
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasTrailingComments(declaration)) {
|
if (hasTrailingComments(declaration)) {
|
||||||
writeTrailingComments(declaration, addNewLine);
|
writeTrailingComments(declaration, false);
|
||||||
} else if (addNewLine) {
|
}
|
||||||
|
if (addNewLine) {
|
||||||
scribe.newLine();
|
scribe.newLine();
|
||||||
}
|
}
|
||||||
if (hasFreestandingComments(declaration)) {
|
if (hasFreestandingComments(declaration)) {
|
||||||
writeFreeStandingComments(declaration);
|
if (declaration instanceof IASTFunctionDefinition) {
|
||||||
}
|
|
||||||
|
|
||||||
if (declaration instanceof ICPPASTUsingDirective) {
|
|
||||||
scribe.newLine();
|
scribe.newLine();
|
||||||
}
|
}
|
||||||
|
writeFreeStandingComments(declaration);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void writeVisibilityLabel(ICPPASTVisibilityLabel visiblityLabel) {
|
private void writeVisibilityLabel(ICPPASTVisibilityLabel visiblityLabel) {
|
||||||
|
@ -181,17 +182,18 @@ public class DeclarationWriter extends NodeWriter{
|
||||||
if (!hasTrailingComments(namespaceDefinition.getName())) {
|
if (!hasTrailingComments(namespaceDefinition.getName())) {
|
||||||
scribe.newLine();
|
scribe.newLine();
|
||||||
}
|
}
|
||||||
scribe.printLBrace();
|
scribe.print('{');
|
||||||
scribe.newLine();
|
scribe.newLine(2);
|
||||||
writeDeclarationsInNamespace(namespaceDefinition, namespaceDefinition.getDeclarations());
|
writeDeclarationsInNamespace(namespaceDefinition, namespaceDefinition.getDeclarations());
|
||||||
if (hasFreestandingComments(namespaceDefinition)) {
|
if (hasFreestandingComments(namespaceDefinition)) {
|
||||||
writeFreeStandingComments(namespaceDefinition);
|
writeFreeStandingComments(namespaceDefinition);
|
||||||
}
|
}
|
||||||
scribe.printRBrace();
|
scribe.newLine();
|
||||||
|
scribe.print('}');
|
||||||
|
|
||||||
if (hasTrailingComments(namespaceDefinition)) {
|
if (hasTrailingComments(namespaceDefinition)) {
|
||||||
writeTrailingComments(namespaceDefinition);
|
writeTrailingComments(namespaceDefinition);
|
||||||
}else{
|
} else {
|
||||||
scribe.newLine();
|
scribe.newLine();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -211,7 +213,7 @@ public class DeclarationWriter extends NodeWriter{
|
||||||
}
|
}
|
||||||
|
|
||||||
private void writeLinkageSpecification(ICPPASTLinkageSpecification linkageSpecification) {
|
private void writeLinkageSpecification(ICPPASTLinkageSpecification linkageSpecification) {
|
||||||
scribe.print( EXTERN);
|
scribe.print(EXTERN);
|
||||||
scribe.print(linkageSpecification.getLiteral());
|
scribe.print(linkageSpecification.getLiteral());
|
||||||
scribe.printSpaces(1);
|
scribe.printSpaces(1);
|
||||||
|
|
||||||
|
@ -266,10 +268,10 @@ public class DeclarationWriter extends NodeWriter{
|
||||||
if (declSpecifier instanceof IASTSimpleDeclSpecifier) {
|
if (declSpecifier instanceof IASTSimpleDeclSpecifier) {
|
||||||
IASTSimpleDeclSpecifier simDeclSpec = (IASTSimpleDeclSpecifier) declSpecifier;
|
IASTSimpleDeclSpecifier simDeclSpec = (IASTSimpleDeclSpecifier) declSpecifier;
|
||||||
if (simDeclSpec.getType() != IASTSimpleDeclSpecifier.t_unspecified) {
|
if (simDeclSpec.getType() != IASTSimpleDeclSpecifier.t_unspecified) {
|
||||||
scribe.printSpace();
|
visitor.setSpaceNeededBeforeName(true);
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
scribe.printSpace();
|
visitor.setSpaceNeededBeforeName(true);
|
||||||
}
|
}
|
||||||
IASTDeclarator declarator = ASTQueries.findOutermostDeclarator(funcDef.getDeclarator());
|
IASTDeclarator declarator = ASTQueries.findOutermostDeclarator(funcDef.getDeclarator());
|
||||||
declarator.accept(visitor);
|
declarator.accept(visitor);
|
||||||
|
@ -325,11 +327,17 @@ public class DeclarationWriter extends NodeWriter{
|
||||||
}
|
}
|
||||||
|
|
||||||
if (decls.length > 0) {
|
if (decls.length > 0) {
|
||||||
|
if (decls.length == 1) {
|
||||||
|
if (!noSpace)
|
||||||
|
visitor.setSpaceNeededBeforeName(true);
|
||||||
|
decls[0].accept(visitor);
|
||||||
|
} else {
|
||||||
if (!noSpace) {
|
if (!noSpace) {
|
||||||
scribe.printSpace();
|
scribe.printSpace();
|
||||||
}
|
}
|
||||||
writeNodeList(decls);
|
writeNodeList(decls);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
printSemicolon();
|
printSemicolon();
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.rewrite.astwriter;
|
package org.eclipse.cdt.internal.core.dom.rewrite.astwriter;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
|
import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
||||||
|
@ -40,14 +39,12 @@ import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.NodeCommentMap;
|
||||||
* @author Emanuel Graf IFS
|
* @author Emanuel Graf IFS
|
||||||
*/
|
*/
|
||||||
public class DeclaratorWriter extends NodeWriter {
|
public class DeclaratorWriter extends NodeWriter {
|
||||||
private static final String AMPERSAND_SPACE = "& "; //$NON-NLS-1$
|
private static final String AMPERSAND_AMPERSAND = "&&"; //$NON-NLS-1$
|
||||||
private static final String AMPERSAND_AMPERSAND_SPACE = "&& "; //$NON-NLS-1$
|
|
||||||
private static final String STAR_SPACE = "* "; //$NON-NLS-1$
|
|
||||||
private static final String PURE_VIRTUAL = " = 0"; //$NON-NLS-1$
|
private static final String PURE_VIRTUAL = " = 0"; //$NON-NLS-1$
|
||||||
private static final String MUTABLE = "mutable"; //$NON-NLS-1$
|
private static final String MUTABLE = "mutable"; //$NON-NLS-1$
|
||||||
private static final String ARROW_OPERATOR = "->"; //$NON-NLS-1$
|
private static final String ARROW_OPERATOR = "->"; //$NON-NLS-1$
|
||||||
|
|
||||||
public DeclaratorWriter(Scribe scribe, ASTVisitor visitor, NodeCommentMap commentMap) {
|
public DeclaratorWriter(Scribe scribe, ASTWriterVisitor visitor, NodeCommentMap commentMap) {
|
||||||
super(scribe, visitor, commentMap);
|
super(scribe, visitor, commentMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,6 +61,7 @@ public class DeclaratorWriter extends NodeWriter {
|
||||||
writeDefaultDeclarator(declarator);
|
writeDefaultDeclarator(declarator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
visitor.setSpaceNeededBeforeName(false);
|
||||||
if (hasTrailingComments(declarator)) {
|
if (hasTrailingComments(declarator)) {
|
||||||
writeTrailingComments(declarator, false);
|
writeTrailingComments(declarator, false);
|
||||||
}
|
}
|
||||||
|
@ -119,6 +117,10 @@ public class DeclaratorWriter extends NodeWriter {
|
||||||
private void writeNestedDeclarator(IASTDeclarator funcDec) {
|
private void writeNestedDeclarator(IASTDeclarator funcDec) {
|
||||||
IASTDeclarator nestedDeclarator = funcDec.getNestedDeclarator();
|
IASTDeclarator nestedDeclarator = funcDec.getNestedDeclarator();
|
||||||
if (nestedDeclarator != null) {
|
if (nestedDeclarator != null) {
|
||||||
|
if (visitor.isSpaceNeededBeforeName()) {
|
||||||
|
scribe.printSpace();
|
||||||
|
visitor.setSpaceNeededBeforeName(false);
|
||||||
|
}
|
||||||
scribe.print('(');
|
scribe.print('(');
|
||||||
nestedDeclarator.accept(visitor);
|
nestedDeclarator.accept(visitor);
|
||||||
scribe.print(')');
|
scribe.print(')');
|
||||||
|
@ -160,10 +162,10 @@ public class DeclaratorWriter extends NodeWriter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void writeParameterDeclarations(IASTStandardFunctionDeclarator funcDec, IASTParameterDeclaration[] paraDecls) {
|
protected void writeParameterDeclarations(IASTStandardFunctionDeclarator funcDec, IASTParameterDeclaration[] paramDecls) {
|
||||||
writeNodeList(paraDecls);
|
writeNodeList(paramDecls);
|
||||||
if (funcDec.takesVarArgs()) {
|
if (funcDec.takesVarArgs()) {
|
||||||
if (paraDecls.length > 0) {
|
if (paramDecls.length > 0) {
|
||||||
scribe.print(COMMA_SPACE);
|
scribe.print(COMMA_SPACE);
|
||||||
}
|
}
|
||||||
scribe.print(VAR_ARGS);
|
scribe.print(VAR_ARGS);
|
||||||
|
@ -175,7 +177,7 @@ public class DeclaratorWriter extends NodeWriter {
|
||||||
ICPPASTPointerToMember pointerToMemberOp = (ICPPASTPointerToMember) operator;
|
ICPPASTPointerToMember pointerToMemberOp = (ICPPASTPointerToMember) operator;
|
||||||
if (pointerToMemberOp.getName() != null) {
|
if (pointerToMemberOp.getName() != null) {
|
||||||
pointerToMemberOp.getName().accept(visitor);
|
pointerToMemberOp.getName().accept(visitor);
|
||||||
scribe.print(STAR_SPACE);
|
scribe.print('*');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
scribe.print('*');
|
scribe.print('*');
|
||||||
|
@ -198,9 +200,9 @@ public class DeclaratorWriter extends NodeWriter {
|
||||||
writePointer(pointOp);
|
writePointer(pointOp);
|
||||||
} else if (operator instanceof ICPPASTReferenceOperator) {
|
} else if (operator instanceof ICPPASTReferenceOperator) {
|
||||||
if (((ICPPASTReferenceOperator) operator).isRValueReference()) {
|
if (((ICPPASTReferenceOperator) operator).isRValueReference()) {
|
||||||
scribe.print(AMPERSAND_AMPERSAND_SPACE);
|
scribe.print(AMPERSAND_AMPERSAND);
|
||||||
} else {
|
} else {
|
||||||
scribe.print(AMPERSAND_SPACE);
|
scribe.print('&');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.rewrite.astwriter;
|
package org.eclipse.cdt.internal.core.dom.rewrite.astwriter;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTArraySubscriptExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTArraySubscriptExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTCastExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTCastExpression;
|
||||||
|
@ -115,7 +114,7 @@ public class ExpressionWriter extends NodeWriter{
|
||||||
private static final String THIS = "this"; //$NON-NLS-1$
|
private static final String THIS = "this"; //$NON-NLS-1$
|
||||||
private final MacroExpansionHandler macroHandler;
|
private final MacroExpansionHandler macroHandler;
|
||||||
|
|
||||||
public ExpressionWriter(Scribe scribe, ASTVisitor visitor, MacroExpansionHandler macroHandler, NodeCommentMap commentMap) {
|
public ExpressionWriter(Scribe scribe, ASTWriterVisitor visitor, MacroExpansionHandler macroHandler, NodeCommentMap commentMap) {
|
||||||
super(scribe, visitor, commentMap);
|
super(scribe, visitor, commentMap);
|
||||||
this.macroHandler = macroHandler;
|
this.macroHandler = macroHandler;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.rewrite.astwriter;
|
package org.eclipse.cdt.internal.core.dom.rewrite.astwriter;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTEqualsInitializer;
|
import org.eclipse.cdt.core.dom.ast.IASTEqualsInitializer;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTInitializer;
|
import org.eclipse.cdt.core.dom.ast.IASTInitializer;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTInitializerClause;
|
import org.eclipse.cdt.core.dom.ast.IASTInitializerClause;
|
||||||
|
@ -36,7 +35,7 @@ import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.NodeCommentMap;
|
||||||
*/
|
*/
|
||||||
public class InitializerWriter extends NodeWriter{
|
public class InitializerWriter extends NodeWriter{
|
||||||
|
|
||||||
public InitializerWriter(Scribe scribe, ASTVisitor visitor, NodeCommentMap commentMap) {
|
public InitializerWriter(Scribe scribe, ASTWriterVisitor visitor, NodeCommentMap commentMap) {
|
||||||
super(scribe, visitor, commentMap);
|
super(scribe, visitor, commentMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.rewrite.astwriter;
|
package org.eclipse.cdt.internal.core.dom.rewrite.astwriter;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
|
@ -36,7 +35,7 @@ public class NameWriter extends NodeWriter {
|
||||||
* @param scribe
|
* @param scribe
|
||||||
* @param visitor
|
* @param visitor
|
||||||
*/
|
*/
|
||||||
public NameWriter(Scribe scribe, ASTVisitor visitor, NodeCommentMap commentMap) {
|
public NameWriter(Scribe scribe, ASTWriterVisitor visitor, NodeCommentMap commentMap) {
|
||||||
super(scribe, visitor, commentMap);
|
super(scribe, visitor, commentMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +44,7 @@ public class NameWriter extends NodeWriter {
|
||||||
writeTempalteId((ICPPASTTemplateId) name);
|
writeTempalteId((ICPPASTTemplateId) name);
|
||||||
} else if (name instanceof ICPPASTConversionName) {
|
} else if (name instanceof ICPPASTConversionName) {
|
||||||
scribe.print(OPERATOR);
|
scribe.print(OPERATOR);
|
||||||
((ICPPASTConversionName)name).getTypeId().accept(visitor);
|
((ICPPASTConversionName) name).getTypeId().accept(visitor);
|
||||||
} else if (name instanceof ICPPASTQualifiedName){
|
} else if (name instanceof ICPPASTQualifiedName){
|
||||||
writeQualifiedName((ICPPASTQualifiedName) name);
|
writeQualifiedName((ICPPASTQualifiedName) name);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -13,7 +13,6 @@ package org.eclipse.cdt.internal.core.dom.rewrite.astwriter;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTComment;
|
import org.eclipse.cdt.core.dom.ast.IASTComment;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTCopyLocation;
|
import org.eclipse.cdt.core.dom.ast.IASTCopyLocation;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
|
@ -28,7 +27,7 @@ import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.NodeCommentMap;
|
||||||
*/
|
*/
|
||||||
public class NodeWriter {
|
public class NodeWriter {
|
||||||
protected Scribe scribe;
|
protected Scribe scribe;
|
||||||
protected ASTVisitor visitor;
|
protected ASTWriterVisitor visitor;
|
||||||
protected NodeCommentMap commentMap;
|
protected NodeCommentMap commentMap;
|
||||||
protected static final String COMMA_SPACE = ", "; //$NON-NLS-1$
|
protected static final String COMMA_SPACE = ", "; //$NON-NLS-1$
|
||||||
protected static final String EQUALS = " = "; //$NON-NLS-1$
|
protected static final String EQUALS = " = "; //$NON-NLS-1$
|
||||||
|
@ -61,7 +60,7 @@ public class NodeWriter {
|
||||||
protected static final String COLON_COLON = "::"; //$NON-NLS-1$
|
protected static final String COLON_COLON = "::"; //$NON-NLS-1$
|
||||||
protected static final String COLON_SPACE = ": "; //$NON-NLS-1$
|
protected static final String COLON_SPACE = ": "; //$NON-NLS-1$
|
||||||
|
|
||||||
public NodeWriter(Scribe scribe, ASTVisitor visitor, NodeCommentMap commentMap) {
|
public NodeWriter(Scribe scribe, ASTWriterVisitor visitor, NodeCommentMap commentMap) {
|
||||||
super();
|
super();
|
||||||
this.scribe = scribe;
|
this.scribe = scribe;
|
||||||
this.visitor = visitor;
|
this.visitor = visitor;
|
||||||
|
@ -89,12 +88,17 @@ public class NodeWriter {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void writeTrailingComments(IASTNode node, boolean newLine) {
|
protected void writeTrailingComments(IASTNode node, boolean newLine) {
|
||||||
|
boolean first = true;
|
||||||
for (IASTComment comment : getTrailingComments(node)) {
|
for (IASTComment comment : getTrailingComments(node)) {
|
||||||
scribe.printSpace();
|
if (!first) {
|
||||||
scribe.print(comment.getComment());
|
|
||||||
if (newLine) {
|
|
||||||
scribe.newLine();
|
scribe.newLine();
|
||||||
}
|
}
|
||||||
|
scribe.printSpace();
|
||||||
|
scribe.print(comment.getComment());
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
|
if (newLine) {
|
||||||
|
scribe.newLine();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,17 +20,18 @@ package org.eclipse.cdt.internal.core.dom.rewrite.astwriter;
|
||||||
*/
|
*/
|
||||||
public class Scribe {
|
public class Scribe {
|
||||||
private int indentationLevel = 0;
|
private int indentationLevel = 0;
|
||||||
private int indentationSize = 4; //HSR tcorbat: could be a tab character too - this is not a very elegant solution
|
// Any positive indentation size is good enough since the code is going to be formatted anyway.
|
||||||
|
private int indentationSize = 4;
|
||||||
private StringBuilder buffer = new StringBuilder();
|
private StringBuilder buffer = new StringBuilder();
|
||||||
private boolean isAtLineBeginning = true;
|
private boolean isAtLineBeginning = true;
|
||||||
private String newLine = System.getProperty("line.separator"); //$NON-NLS-1$
|
private String newLine = System.getProperty("line.separator"); //$NON-NLS-1$
|
||||||
private String givenIndentation = null;
|
private String givenIndentation;
|
||||||
|
|
||||||
private boolean noNewLine = false;
|
private boolean skipLineBreaks;
|
||||||
private boolean noSemicolon = false;
|
private boolean skipSemicolons;
|
||||||
|
|
||||||
public void newLine() {
|
public void newLine() {
|
||||||
if (!noNewLine) {
|
if (!skipLineBreaks) {
|
||||||
isAtLineBeginning = true;
|
isAtLineBeginning = true;
|
||||||
buffer.append(getNewline());
|
buffer.append(getNewline());
|
||||||
}
|
}
|
||||||
|
@ -88,15 +89,15 @@ public class Scribe {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void noSemicolon() {
|
public void noSemicolon() {
|
||||||
noSemicolon = true;
|
skipSemicolons = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void printSemicolon() {
|
public void printSemicolon() {
|
||||||
if (!noSemicolon) {
|
if (!skipSemicolons) {
|
||||||
indentIfNewLine();
|
indentIfNewLine();
|
||||||
buffer.append(';');
|
buffer.append(';');
|
||||||
} else {
|
} else {
|
||||||
noSemicolon = false;
|
skipSemicolons = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,7 +106,7 @@ public class Scribe {
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void print (char code) {
|
public void print(char code) {
|
||||||
indentIfNewLine();
|
indentIfNewLine();
|
||||||
buffer.append(code);
|
buffer.append(code);
|
||||||
}
|
}
|
||||||
|
@ -126,7 +127,7 @@ public class Scribe {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prints a { to the Buffer an increases the indentation level.
|
* Prints a { to the buffer an increases the indentation level.
|
||||||
*/
|
*/
|
||||||
public void printLBrace() {
|
public void printLBrace() {
|
||||||
print('{');
|
print('{');
|
||||||
|
@ -134,7 +135,7 @@ public class Scribe {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prints a } to the Buffer an decrease the indentation level.
|
* Prints a } to the buffer an decrease the indentation level.
|
||||||
*/
|
*/
|
||||||
public void printRBrace() {
|
public void printRBrace() {
|
||||||
--indentationLevel;
|
--indentationLevel;
|
||||||
|
@ -152,11 +153,11 @@ public class Scribe {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void noNewLines() {
|
protected void noNewLines() {
|
||||||
noNewLine = true;
|
skipLineBreaks = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void newLines() {
|
protected void newLines() {
|
||||||
noNewLine = false;
|
skipLineBreaks = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void newLine(int i) {
|
public void newLine(int i) {
|
||||||
|
|
|
@ -56,17 +56,17 @@ import org.eclipse.core.resources.IFile;
|
||||||
public class StatementWriter extends NodeWriter {
|
public class StatementWriter extends NodeWriter {
|
||||||
private static final String DEFAULT = "default:"; //$NON-NLS-1$
|
private static final String DEFAULT = "default:"; //$NON-NLS-1$
|
||||||
private static final String CASE = "case "; //$NON-NLS-1$
|
private static final String CASE = "case "; //$NON-NLS-1$
|
||||||
private static final String WHILE = "while("; //$NON-NLS-1$
|
private static final String WHILE = "while ("; //$NON-NLS-1$
|
||||||
private static final String TRY = "try "; //$NON-NLS-1$
|
private static final String TRY = "try "; //$NON-NLS-1$
|
||||||
private static final String CATCH = "catch("; //$NON-NLS-1$
|
private static final String CATCH = "catch ("; //$NON-NLS-1$
|
||||||
private static final String RETURN = "return"; //$NON-NLS-1$
|
private static final String RETURN = "return"; //$NON-NLS-1$
|
||||||
private static final String GOTO = "goto "; //$NON-NLS-1$
|
private static final String GOTO = "goto "; //$NON-NLS-1$
|
||||||
private static final String CONTINUE = "continue"; //$NON-NLS-1$
|
private static final String CONTINUE = "continue"; //$NON-NLS-1$
|
||||||
private static final String BREAK = "break"; //$NON-NLS-1$
|
private static final String BREAK = "break"; //$NON-NLS-1$
|
||||||
private static final String ELSE = "else"; //$NON-NLS-1$
|
private static final String ELSE = "else"; //$NON-NLS-1$
|
||||||
private static final String IF = "if("; //$NON-NLS-1$
|
private static final String IF = "if ("; //$NON-NLS-1$
|
||||||
private static final String FOR = "for("; //$NON-NLS-1$
|
private static final String FOR = "for ("; //$NON-NLS-1$
|
||||||
private static final String DO_WHILE = " while("; //$NON-NLS-1$
|
private static final String DO_WHILE = " while ("; //$NON-NLS-1$
|
||||||
private static final String DO = "do"; //$NON-NLS-1$
|
private static final String DO = "do"; //$NON-NLS-1$
|
||||||
private static final String SWITCH_BRACKET = "switch ("; //$NON-NLS-1$
|
private static final String SWITCH_BRACKET = "switch ("; //$NON-NLS-1$
|
||||||
private boolean compoundNoNewLine = false;
|
private boolean compoundNoNewLine = false;
|
||||||
|
@ -74,14 +74,15 @@ public class StatementWriter extends NodeWriter {
|
||||||
private boolean decrementIndentationLevelOneMore = false;
|
private boolean decrementIndentationLevelOneMore = false;
|
||||||
private final DeclarationWriter declWriter;
|
private final DeclarationWriter declWriter;
|
||||||
|
|
||||||
public StatementWriter(Scribe scribe, ASTVisitor visitor, NodeCommentMap commentMap) {
|
public StatementWriter(Scribe scribe, ASTWriterVisitor visitor, NodeCommentMap commentMap) {
|
||||||
super(scribe, visitor, commentMap);
|
super(scribe, visitor, commentMap);
|
||||||
declWriter = new DeclarationWriter(scribe, visitor, commentMap);
|
declWriter = new DeclarationWriter(scribe, visitor, commentMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Prints a statement.
|
||||||
*
|
*
|
||||||
* @param statement
|
* @param statement the statement
|
||||||
* @param newLine if true print a newline if statement usually have one.
|
* @param newLine if true print a newline if statement usually have one.
|
||||||
* @return {@link ASTVisitor#PROCESS_SKIP}
|
* @return {@link ASTVisitor#PROCESS_SKIP}
|
||||||
*/
|
*/
|
||||||
|
@ -132,7 +133,7 @@ public class StatementWriter extends NodeWriter {
|
||||||
writeIfStatement((IASTIfStatement) statement);
|
writeIfStatement((IASTIfStatement) statement);
|
||||||
newLine = false;
|
newLine = false;
|
||||||
} else if (statement instanceof IASTWhileStatement) {
|
} else if (statement instanceof IASTWhileStatement) {
|
||||||
writeWhileStatement( (IASTWhileStatement) statement );
|
writeWhileStatement((IASTWhileStatement) statement);
|
||||||
newLine = false;
|
newLine = false;
|
||||||
} else if (statement instanceof IASTForStatement) {
|
} else if (statement instanceof IASTForStatement) {
|
||||||
writeForStatement((IASTForStatement) statement);
|
writeForStatement((IASTForStatement) statement);
|
||||||
|
@ -173,12 +174,12 @@ public class StatementWriter extends NodeWriter {
|
||||||
scribe.printSemicolon();
|
scribe.printSemicolon();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void writeForStatement(IASTForStatement forStatment) {
|
private void writeForStatement(IASTForStatement forStatement) {
|
||||||
scribe.noNewLines();
|
scribe.noNewLines();
|
||||||
scribe.print(FOR);
|
scribe.print(FOR);
|
||||||
writeStatement(forStatment.getInitializerStatement(),false);
|
writeStatement(forStatement.getInitializerStatement(),false);
|
||||||
if (forStatment instanceof ICPPASTForStatement) {
|
if (forStatement instanceof ICPPASTForStatement) {
|
||||||
ICPPASTForStatement cppForStatment = (ICPPASTForStatement) forStatment;
|
ICPPASTForStatement cppForStatment = (ICPPASTForStatement) forStatement;
|
||||||
IASTDeclaration cppConditionDeclaration = cppForStatment.getConditionDeclaration();
|
IASTDeclaration cppConditionDeclaration = cppForStatment.getConditionDeclaration();
|
||||||
if (cppConditionDeclaration == null) {
|
if (cppConditionDeclaration == null) {
|
||||||
visitNodeIfNotNull(cppForStatment.getConditionExpression());
|
visitNodeIfNotNull(cppForStatment.getConditionExpression());
|
||||||
|
@ -187,17 +188,17 @@ public class StatementWriter extends NodeWriter {
|
||||||
cppConditionDeclaration.accept(visitor);
|
cppConditionDeclaration.accept(visitor);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (forStatment.getConditionExpression() != null) {
|
if (forStatement.getConditionExpression() != null) {
|
||||||
forStatment.getConditionExpression().accept(visitor);
|
forStatement.getConditionExpression().accept(visitor);
|
||||||
scribe.printSemicolon();
|
scribe.printSemicolon();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
visitNodeIfNotNull(forStatment.getIterationExpression());
|
visitNodeIfNotNull(forStatement.getIterationExpression());
|
||||||
scribe.print(')');
|
scribe.print(')');
|
||||||
scribe.newLines();
|
scribe.newLines();
|
||||||
nextCompoundNoNewLine();
|
nextCompoundNoNewLine();
|
||||||
writeBodyStatement(forStatment.getBody(), false);
|
writeBodyStatement(forStatement.getBody(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void writeForStatement(ICPPASTRangeBasedForStatement forStatment) {
|
private void writeForStatement(ICPPASTRangeBasedForStatement forStatment) {
|
||||||
|
@ -418,7 +419,6 @@ public class StatementWriter extends NodeWriter {
|
||||||
scribe.newLine();
|
scribe.newLine();
|
||||||
statement.accept(visitor);
|
statement.accept(visitor);
|
||||||
scribe.decrementIndentationLevel();
|
scribe.decrementIndentationLevel();
|
||||||
scribe.newLine();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.rewrite.astwriter;
|
package org.eclipse.cdt.internal.core.dom.rewrite.astwriter;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTParameterDeclaration;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTParameterDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTSimpleTypeTemplateParameter;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTSimpleTypeTemplateParameter;
|
||||||
|
@ -35,7 +34,7 @@ public class TemplateParameterWriter extends NodeWriter {
|
||||||
* @param scribe
|
* @param scribe
|
||||||
* @param visitor
|
* @param visitor
|
||||||
*/
|
*/
|
||||||
public TemplateParameterWriter(Scribe scribe, ASTVisitor visitor, NodeCommentMap commentMap) {
|
public TemplateParameterWriter(Scribe scribe, ASTWriterVisitor visitor, NodeCommentMap commentMap) {
|
||||||
super(scribe, visitor, commentMap);
|
super(scribe, visitor, commentMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,8 +44,7 @@ public class ASTModificationHelper {
|
||||||
T appendedTNode = cast(newNode, clazz);
|
T appendedTNode = cast(newNode, clazz);
|
||||||
if (appendedTNode != null) {
|
if (appendedTNode != null) {
|
||||||
modifiedChildren.add(appendedTNode);
|
modifiedChildren.add(appendedTNode);
|
||||||
}
|
} else if (newNode instanceof ContainerNode) {
|
||||||
else if (newNode instanceof ContainerNode) {
|
|
||||||
ContainerNode nodeContainer = (ContainerNode) newNode;
|
ContainerNode nodeContainer = (ContainerNode) newNode;
|
||||||
for (IASTNode currentNode : nodeContainer.getNodes()) {
|
for (IASTNode currentNode : nodeContainer.getNodes()) {
|
||||||
T tnode= cast(currentNode, clazz);
|
T tnode= cast(currentNode, clazz);
|
||||||
|
|
|
@ -9,16 +9,23 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Institute for Software - initial API and implementation
|
* Institute for Software - initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.rewrite.changegenerator;
|
package org.eclipse.cdt.internal.core.dom.rewrite.changegenerator;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
|
import org.eclipse.cdt.core.ToolFactory;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
|
import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTComment;
|
import org.eclipse.cdt.core.dom.ast.IASTComment;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
||||||
|
@ -31,7 +38,10 @@ import org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceDefinition;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceDefinition;
|
||||||
|
import org.eclipse.cdt.core.formatter.CodeFormatter;
|
||||||
|
import org.eclipse.cdt.core.model.ICProject;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification.ModificationKind;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationMap;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationMap;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTRewriteAnalyzer;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTRewriteAnalyzer;
|
||||||
|
@ -41,16 +51,26 @@ import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.NodeCommentMap;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.util.FileContentHelper;
|
import org.eclipse.cdt.internal.core.dom.rewrite.util.FileContentHelper;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.util.FileHelper;
|
import org.eclipse.cdt.internal.core.dom.rewrite.util.FileHelper;
|
||||||
import org.eclipse.cdt.internal.core.resources.ResourceLookup;
|
import org.eclipse.cdt.internal.core.resources.ResourceLookup;
|
||||||
|
import org.eclipse.cdt.internal.formatter.CCodeFormatter;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
|
import org.eclipse.core.runtime.Assert;
|
||||||
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.core.runtime.Path;
|
import org.eclipse.core.runtime.Path;
|
||||||
|
import org.eclipse.jface.text.BadLocationException;
|
||||||
|
import org.eclipse.jface.text.Document;
|
||||||
|
import org.eclipse.jface.text.IDocument;
|
||||||
|
import org.eclipse.jface.text.IRegion;
|
||||||
|
import org.eclipse.jface.text.TextUtilities;
|
||||||
import org.eclipse.ltk.core.refactoring.Change;
|
import org.eclipse.ltk.core.refactoring.Change;
|
||||||
import org.eclipse.ltk.core.refactoring.CompositeChange;
|
import org.eclipse.ltk.core.refactoring.CompositeChange;
|
||||||
import org.eclipse.ltk.core.refactoring.TextFileChange;
|
import org.eclipse.ltk.core.refactoring.TextFileChange;
|
||||||
import org.eclipse.text.edits.DeleteEdit;
|
import org.eclipse.text.edits.DeleteEdit;
|
||||||
import org.eclipse.text.edits.InsertEdit;
|
import org.eclipse.text.edits.InsertEdit;
|
||||||
|
import org.eclipse.text.edits.MalformedTreeException;
|
||||||
import org.eclipse.text.edits.MultiTextEdit;
|
import org.eclipse.text.edits.MultiTextEdit;
|
||||||
import org.eclipse.text.edits.ReplaceEdit;
|
import org.eclipse.text.edits.ReplaceEdit;
|
||||||
|
import org.eclipse.text.edits.TextEdit;
|
||||||
import org.eclipse.text.edits.TextEditGroup;
|
import org.eclipse.text.edits.TextEditGroup;
|
||||||
|
|
||||||
public class ChangeGenerator extends ASTVisitor {
|
public class ChangeGenerator extends ASTVisitor {
|
||||||
|
@ -93,8 +113,10 @@ public class ChangeGenerator extends ASTVisitor {
|
||||||
initParentModList();
|
initParentModList();
|
||||||
rootNode.accept(pathProvider);
|
rootNode.accept(pathProvider);
|
||||||
for (IFile currentFile : changes.keySet()) {
|
for (IFile currentFile : changes.keySet()) {
|
||||||
|
MultiTextEdit edit = changes.get(currentFile);
|
||||||
|
edit = formatChangedCode(edit, currentFile);
|
||||||
TextFileChange subchange= ASTRewriteAnalyzer.createCTextFileChange(currentFile);
|
TextFileChange subchange= ASTRewriteAnalyzer.createCTextFileChange(currentFile);
|
||||||
subchange.setEdit(changes.get(currentFile));
|
subchange.setEdit(edit);
|
||||||
change.add(subchange);
|
change.add(subchange);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -130,6 +152,63 @@ public class ChangeGenerator extends ASTVisitor {
|
||||||
return modifiedNodeParent;
|
return modifiedNodeParent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Applies the C++ code formatter to the code affected by refactoring.
|
||||||
|
*
|
||||||
|
* @param edit The text edit produced by refactoring.
|
||||||
|
* @param file The file being modified.
|
||||||
|
* @return The text edit containing formatted refactoring changes, or the original text edit
|
||||||
|
* in case of errors.
|
||||||
|
*/
|
||||||
|
private MultiTextEdit formatChangedCode(MultiTextEdit edit, IFile file) {
|
||||||
|
String code;
|
||||||
|
try {
|
||||||
|
code = FileContentHelper.getContent(file, 0);
|
||||||
|
} catch (IOException e) {
|
||||||
|
CCorePlugin.log(e);
|
||||||
|
return edit;
|
||||||
|
} catch (CoreException e) {
|
||||||
|
CCorePlugin.log(e);
|
||||||
|
return edit;
|
||||||
|
}
|
||||||
|
IDocument document = new Document(code);
|
||||||
|
try {
|
||||||
|
TextEdit tempEdit = edit.copy();
|
||||||
|
tempEdit.apply(document, TextEdit.UPDATE_REGIONS);
|
||||||
|
TextEdit[] edits = tempEdit.getChildren();
|
||||||
|
IRegion[] regions = new IRegion[edits.length];
|
||||||
|
for (int i = 0; i < edits.length; i++) {
|
||||||
|
regions[i] = edits[i].getRegion();
|
||||||
|
}
|
||||||
|
ICProject project = CCorePlugin.getDefault().getCoreModel().create(file.getProject());
|
||||||
|
Map<String, String> options = project.getOptions(true);
|
||||||
|
CodeFormatter formatter = ToolFactory.createCodeFormatter(options);
|
||||||
|
code = document.get();
|
||||||
|
TextEdit[] formatEdits = formatter.format(CCodeFormatter.K_TRANSLATION_UNIT, code,
|
||||||
|
regions, TextUtilities.getDefaultLineDelimiter(document));
|
||||||
|
MultiTextEdit resultEdit = new MultiTextEdit();
|
||||||
|
edits = edit.getChildren();
|
||||||
|
for (int i = 0; i < edits.length; i++) {
|
||||||
|
IRegion region = regions[i];
|
||||||
|
int offset = region.getOffset();
|
||||||
|
TextEdit formatEdit = formatEdits[i];
|
||||||
|
formatEdit.moveTree(-offset);
|
||||||
|
document = new Document(code.substring(offset, offset + region.getLength()));
|
||||||
|
formatEdit.apply(document, TextEdit.NONE);
|
||||||
|
TextEdit textEdit = edits[i];
|
||||||
|
resultEdit.addChild(
|
||||||
|
new ReplaceEdit(textEdit.getOffset(), textEdit.getLength(), document.get()));
|
||||||
|
}
|
||||||
|
return resultEdit;
|
||||||
|
} catch (MalformedTreeException e) {
|
||||||
|
CCorePlugin.log(e);
|
||||||
|
return edit;
|
||||||
|
} catch (BadLocationException e) {
|
||||||
|
CCorePlugin.log(e);
|
||||||
|
return edit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int visit(IASTTranslationUnit translationUnit) {
|
public int visit(IASTTranslationUnit translationUnit) {
|
||||||
if (hasChangedChild(translationUnit)) {
|
if (hasChangedChild(translationUnit)) {
|
||||||
|
@ -145,11 +224,6 @@ public class ChangeGenerator extends ASTVisitor {
|
||||||
return super.leave(tu);
|
return super.leave(tu);
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getOffsetForNodeFile(IASTNode rootNode) {
|
|
||||||
Integer offset = sourceOffsets.get(rootNode.getFileLocation().getFileName());
|
|
||||||
return offset == null ? 0 : offset.intValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int visit(IASTDeclaration declaration) {
|
public int visit(IASTDeclaration declaration) {
|
||||||
if (hasChangedChild(declaration)) {
|
if (hasChangedChild(declaration)) {
|
||||||
|
@ -160,16 +234,10 @@ public class ChangeGenerator extends ASTVisitor {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void synthTreatment(IASTNode synthNode) {
|
private void synthTreatment(IASTNode synthNode) {
|
||||||
synthTreatment(synthNode, null);
|
ChangeGeneratorWriterVisitor writer =
|
||||||
}
|
new ChangeGeneratorWriterVisitor(modificationStore, commentMap);
|
||||||
|
synthNode.accept(writer);
|
||||||
private void synthTreatment(IASTNode synthNode, String fileScope) {
|
String synthSource = writer.toString();
|
||||||
String indent = getIndent(synthNode);
|
|
||||||
ASTWriter synthWriter = new ASTWriter(indent);
|
|
||||||
synthWriter.setModificationStore(modificationStore);
|
|
||||||
|
|
||||||
String synthSource = synthWriter.write(synthNode, fileScope, commentMap);
|
|
||||||
|
|
||||||
createChange(synthNode, synthSource);
|
createChange(synthNode, synthSource);
|
||||||
|
|
||||||
IASTFileLocation fileLocation = synthNode.getFileLocation();
|
IASTFileLocation fileLocation = synthNode.getFileLocation();
|
||||||
|
@ -177,16 +245,115 @@ public class ChangeGenerator extends ASTVisitor {
|
||||||
sourceOffsets.put(fileLocation.getFileName(), Integer.valueOf(newOffset));
|
sourceOffsets.put(fileLocation.getFileName(), Integer.valueOf(newOffset));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void handleAppends(IASTNode node) {
|
||||||
|
ChangeGeneratorWriterVisitor writer =
|
||||||
|
new ChangeGeneratorWriterVisitor(modificationStore, commentMap);
|
||||||
|
List<ASTModification> modifications = modificationParent.get(node);
|
||||||
|
ReplaceEdit anchor = getAppendAnchor(node);
|
||||||
|
Assert.isNotNull(anchor);
|
||||||
|
IASTNode precedingNode = getLastNodeBeforeAppendPoint(node);
|
||||||
|
if (precedingNode != null &&
|
||||||
|
ASTWriter.requireBlankLineInBetween(precedingNode, modifications.get(0).getNewNode())) {
|
||||||
|
writer.newLine();
|
||||||
|
}
|
||||||
|
for (ASTModification modification : modifications) {
|
||||||
|
IASTNode newNode = modification.getNewNode();
|
||||||
|
newNode.accept(writer);
|
||||||
|
}
|
||||||
|
String code = writer.toString();
|
||||||
|
IFile file = FileHelper.getFileFromNode(node);
|
||||||
|
MultiTextEdit parentEdit = getEdit(node, file);
|
||||||
|
ReplaceEdit edit = new ReplaceEdit(anchor.getOffset(), anchor.getLength(),
|
||||||
|
code + anchor.getText());
|
||||||
|
parentEdit.addChild(edit);
|
||||||
|
IASTFileLocation fileLocation = node.getFileLocation();
|
||||||
|
int newOffset = fileLocation.getNodeOffset() + fileLocation.getNodeLength();
|
||||||
|
sourceOffsets.put(fileLocation.getFileName(), Integer.valueOf(newOffset));
|
||||||
|
}
|
||||||
|
|
||||||
|
private IASTNode getLastNodeBeforeAppendPoint(IASTNode node) {
|
||||||
|
IASTNode[] children;
|
||||||
|
if (node instanceof IASTCompositeTypeSpecifier) {
|
||||||
|
children = ((IASTCompositeTypeSpecifier) node).getDeclarations(true);
|
||||||
|
} else {
|
||||||
|
children = node.getChildren();
|
||||||
|
}
|
||||||
|
return children.length > 0 ? children[children.length - 1] : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isAppendable(Iterable<ASTModification> modifications) {
|
||||||
|
for (ASTModification modification : modifications) {
|
||||||
|
if (!isAppendable(modification))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isAppendable(ASTModification modification) {
|
||||||
|
if (modification.getKind() != ModificationKind.APPEND_CHILD)
|
||||||
|
return false;
|
||||||
|
IASTNode node = modification.getNewNode();
|
||||||
|
return node instanceof IASTDeclaration || node instanceof IASTStatement;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a replace edit whose offset is the position where child appended nodes should be
|
||||||
|
* inserted at. The text contains the content of the code region that will be disturbed by
|
||||||
|
* the insertion.
|
||||||
|
* @param node The node to append children to.
|
||||||
|
* @return a ReplaceEdit object, or <code>null</code> if the node does not support appending
|
||||||
|
* children to it.
|
||||||
|
*/
|
||||||
|
private ReplaceEdit getAppendAnchor(IASTNode node) {
|
||||||
|
if (!(node instanceof IASTCompositeTypeSpecifier ||
|
||||||
|
node instanceof IASTCompoundStatement ||
|
||||||
|
node instanceof ICPPASTNamespaceDefinition)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
IFile file = FileHelper.getFileFromNode(node);
|
||||||
|
String code = originalCodeOfNode(node, file);
|
||||||
|
IASTFileLocation location = node.getFileLocation();
|
||||||
|
int pos = location.getNodeOffset() + location.getNodeLength();
|
||||||
|
int len = code.endsWith("}") ? 1 : 0; //$NON-NLS-1$
|
||||||
|
int startOfLine = skipPrecedingBlankLines(code, code.length() - len);
|
||||||
|
if (startOfLine < 0) {
|
||||||
|
// Include the closing brace in the region that will be reformatted.
|
||||||
|
return new ReplaceEdit(pos - len, len, code.substring(code.length() - len));
|
||||||
|
}
|
||||||
|
return new ReplaceEdit(location.getNodeOffset() + startOfLine, 0, ""); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skips blank lines preceding the given position.
|
||||||
|
* @param text the text to scan
|
||||||
|
* @param pos the position after that blank lines.
|
||||||
|
* @return the beginning of the first blank line, or -1 if the beginning of the line
|
||||||
|
* corresponding to the given position contains non-whitespace characters.
|
||||||
|
*/
|
||||||
|
private int skipPrecedingBlankLines(String text, int pos) {
|
||||||
|
int lineStart = -1;
|
||||||
|
while (--pos >= 0) {
|
||||||
|
char c = text.charAt(pos);
|
||||||
|
if (c == '\n') {
|
||||||
|
lineStart = pos + 1;
|
||||||
|
} else if (!Character.isWhitespace(c)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return lineStart;
|
||||||
|
}
|
||||||
|
|
||||||
private void synthTreatment(IASTTranslationUnit synthTU) {
|
private void synthTreatment(IASTTranslationUnit synthTU) {
|
||||||
ASTWriter synthWriter = new ASTWriter();
|
ASTWriter synthWriter = new ASTWriter();
|
||||||
synthWriter.setModificationStore(modificationStore);
|
synthWriter.setModificationStore(modificationStore);
|
||||||
|
|
||||||
for (ASTModification modification : modificationParent.get(synthTU)) {
|
for (ASTModification modification : modificationParent.get(synthTU)) {
|
||||||
IASTFileLocation targetLocation = modification.getTargetNode().getFileLocation();
|
IASTNode targetNode = modification.getTargetNode();
|
||||||
|
IASTFileLocation targetLocation = targetNode.getFileLocation();
|
||||||
String currentFile = targetLocation.getFileName();
|
String currentFile = targetLocation.getFileName();
|
||||||
IPath implPath = new Path(currentFile);
|
IPath implPath = new Path(currentFile);
|
||||||
IFile relevantFile= ResourceLookup.selectFileForLocation(implPath, null);
|
IFile relevantFile= ResourceLookup.selectFileForLocation(implPath, null);
|
||||||
if (relevantFile == null || !relevantFile.exists()) { // if not in workspace or local file system
|
if (relevantFile == null || !relevantFile.exists()) { // If not in workspace or local file system
|
||||||
throw new UnhandledASTModificationException(modification);
|
throw new UnhandledASTModificationException(modification);
|
||||||
}
|
}
|
||||||
MultiTextEdit edit;
|
MultiTextEdit edit;
|
||||||
|
@ -196,7 +363,7 @@ public class ChangeGenerator extends ASTVisitor {
|
||||||
edit = new MultiTextEdit();
|
edit = new MultiTextEdit();
|
||||||
changes.put(relevantFile, edit);
|
changes.put(relevantFile, edit);
|
||||||
}
|
}
|
||||||
String newNodeCode = synthWriter.write(modification.getNewNode(), null, commentMap);
|
String newNodeCode = synthWriter.write(modification.getNewNode(), commentMap);
|
||||||
|
|
||||||
switch (modification.getKind()) {
|
switch (modification.getKind()) {
|
||||||
case REPLACE:
|
case REPLACE:
|
||||||
|
@ -204,18 +371,20 @@ public class ChangeGenerator extends ASTVisitor {
|
||||||
targetLocation.getNodeLength(), newNodeCode));
|
targetLocation.getNodeLength(), newNodeCode));
|
||||||
break;
|
break;
|
||||||
case INSERT_BEFORE:
|
case INSERT_BEFORE:
|
||||||
edit.addChild(new InsertEdit(getOffsetIncludingComments(modification.getTargetNode()),
|
if (ASTWriter.requireBlankLineInBetween(modification.getNewNode(), targetNode)) {
|
||||||
newNodeCode));
|
newNodeCode = newNodeCode + "\n"; //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
edit.addChild(new InsertEdit(getOffsetIncludingComments(targetNode), newNodeCode));
|
||||||
break;
|
break;
|
||||||
case APPEND_CHILD:
|
case APPEND_CHILD:
|
||||||
if (modification.getTargetNode() instanceof IASTTranslationUnit &&
|
if (targetNode instanceof IASTTranslationUnit &&
|
||||||
((IASTTranslationUnit)modification.getTargetNode()).getDeclarations().length > 0) {
|
((IASTTranslationUnit) targetNode).getDeclarations().length > 0) {
|
||||||
IASTTranslationUnit tu = (IASTTranslationUnit)modification.getTargetNode();
|
IASTTranslationUnit tu = (IASTTranslationUnit) targetNode;
|
||||||
IASTDeclaration lastDecl = tu.getDeclarations()[tu.getDeclarations().length - 1];
|
IASTDeclaration lastDecl = tu.getDeclarations()[tu.getDeclarations().length - 1];
|
||||||
targetLocation = lastDecl.getFileLocation();
|
targetLocation = lastDecl.getFileLocation();
|
||||||
}
|
}
|
||||||
String lineDelimiter = FileHelper.determineLineDelimiter(
|
String lineDelimiter = FileHelper.determineLineDelimiter(
|
||||||
FileHelper.getFileFromNode(modification.getTargetNode()));
|
FileHelper.getFileFromNode(targetNode));
|
||||||
edit.addChild(new InsertEdit(targetLocation.getNodeOffset() + targetLocation.getNodeLength(),
|
edit.addChild(new InsertEdit(targetLocation.getNodeOffset() + targetLocation.getNodeLength(),
|
||||||
lineDelimiter + lineDelimiter + newNodeCode));
|
lineDelimiter + lineDelimiter + newNodeCode));
|
||||||
break;
|
break;
|
||||||
|
@ -225,31 +394,33 @@ public class ChangeGenerator extends ASTVisitor {
|
||||||
|
|
||||||
private void createChange(IASTNode synthNode, String synthSource) {
|
private void createChange(IASTNode synthNode, String synthSource) {
|
||||||
IFile relevantFile = FileHelper.getFileFromNode(synthNode);
|
IFile relevantFile = FileHelper.getFileFromNode(synthNode);
|
||||||
|
String originalCode = originalCodeOfNode(synthNode, relevantFile);
|
||||||
String originalCode = originalCodeOfNode(synthNode);
|
|
||||||
CodeComparer codeComparer = new CodeComparer(originalCode, synthSource);
|
CodeComparer codeComparer = new CodeComparer(originalCode, synthSource);
|
||||||
|
codeComparer.createChange(getEdit(synthNode, relevantFile), synthNode);
|
||||||
|
}
|
||||||
|
|
||||||
MultiTextEdit edit;
|
private MultiTextEdit getEdit(IASTNode modifiedNode, IFile file) {
|
||||||
if (changes.containsKey(relevantFile)) {
|
MultiTextEdit edit = changes.get(file);
|
||||||
edit = changes.get(relevantFile);
|
if (edit == null) {
|
||||||
} else {
|
|
||||||
edit = new MultiTextEdit();
|
edit = new MultiTextEdit();
|
||||||
changes.put(relevantFile, edit);
|
changes.put(file, edit);
|
||||||
|
}
|
||||||
|
TextEditGroup editGroup = new TextEditGroup(Messages.ChangeGenerator_group);
|
||||||
|
for (ASTModification currentModification : modificationParent.get(modifiedNode)) {
|
||||||
|
if (currentModification.getAssociatedEditGroup() != null) {
|
||||||
|
editGroup = currentModification.getAssociatedEditGroup();
|
||||||
|
edit.addChildren(editGroup.getTextEdits());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return edit;
|
||||||
}
|
}
|
||||||
|
|
||||||
codeComparer.createChange(edit, synthNode);
|
private String originalCodeOfNode(IASTNode node, IFile sourceFile) {
|
||||||
}
|
|
||||||
|
|
||||||
public String originalCodeOfNode(IASTNode node) {
|
|
||||||
if (node.getFileLocation() != null) {
|
|
||||||
IFile sourceFile = FileHelper.getFileFromNode(node);
|
|
||||||
int nodeOffset = getOffsetIncludingComments(node);
|
int nodeOffset = getOffsetIncludingComments(node);
|
||||||
int nodeLength = getNodeLengthIncludingComments(node);
|
int nodeLength = getNodeLengthIncludingComments(node);
|
||||||
|
|
||||||
return FileContentHelper.getContent(sourceFile, nodeOffset, nodeLength);
|
return FileContentHelper.getContent(sourceFile, nodeOffset, nodeLength);
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private int getNodeLengthIncludingComments(IASTNode node) {
|
private int getNodeLengthIncludingComments(IASTNode node) {
|
||||||
int nodeOffset = node.getFileLocation().getNodeOffset();
|
int nodeOffset = node.getFileLocation().getNodeOffset();
|
||||||
|
@ -290,23 +461,15 @@ public class ChangeGenerator extends ASTVisitor {
|
||||||
return nodeOffset;
|
return nodeOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getIndent(IASTNode nextNode) {
|
private boolean hasChangedChild(IASTNode node) {
|
||||||
IASTFileLocation fileLocation = nextNode.getFileLocation();
|
return modificationParent.containsKey(node);
|
||||||
int length = fileLocation.getNodeOffset() - getOffsetForNodeFile(nextNode);
|
|
||||||
|
|
||||||
String originalSource = FileContentHelper.getContent(FileHelper.getFileFromNode(nextNode),
|
|
||||||
getOffsetForNodeFile(nextNode), length);
|
|
||||||
StringBuilder indent = new StringBuilder(originalSource);
|
|
||||||
indent.reverse();
|
|
||||||
String lastline = indent.substring(0, Math.max(indent.indexOf("\n"), 0)); //$NON-NLS-1$
|
|
||||||
if (lastline.trim().length() == 0) {
|
|
||||||
return lastline;
|
|
||||||
}
|
|
||||||
return ""; //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean hasChangedChild(IASTNode parent) {
|
private boolean hasAppendsOnly(IASTNode node) {
|
||||||
return modificationParent.containsKey(parent);
|
List<ASTModification> modifications = modificationParent.get(node);
|
||||||
|
if (modifications == null)
|
||||||
|
return false;
|
||||||
|
return isAppendable(modifications);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -329,22 +492,38 @@ public class ChangeGenerator extends ASTVisitor {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int visit(ICPPASTNamespaceDefinition namespaceDefinition) {
|
public int visit(ICPPASTNamespaceDefinition namespaceDefinition) {
|
||||||
if (hasChangedChild(namespaceDefinition)) {
|
if (hasChangedChild(namespaceDefinition) && !hasAppendsOnly(namespaceDefinition)) {
|
||||||
synthTreatment(namespaceDefinition);
|
synthTreatment(namespaceDefinition);
|
||||||
return ASTVisitor.PROCESS_SKIP;
|
return ASTVisitor.PROCESS_SKIP;
|
||||||
}
|
}
|
||||||
return super.visit(namespaceDefinition);
|
return super.visit(namespaceDefinition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int leave(ICPPASTNamespaceDefinition namespaceDefinition) {
|
||||||
|
if (hasAppendsOnly(namespaceDefinition)) {
|
||||||
|
handleAppends(namespaceDefinition);
|
||||||
|
}
|
||||||
|
return super.leave(namespaceDefinition);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int visit(IASTDeclSpecifier declSpec) {
|
public int visit(IASTDeclSpecifier declSpec) {
|
||||||
if (hasChangedChild(declSpec)) {
|
if (hasChangedChild(declSpec) && !hasAppendsOnly(declSpec)) {
|
||||||
synthTreatment(declSpec);
|
synthTreatment(declSpec);
|
||||||
return ASTVisitor.PROCESS_SKIP;
|
return ASTVisitor.PROCESS_SKIP;
|
||||||
}
|
}
|
||||||
return super.visit(declSpec);
|
return super.visit(declSpec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int leave(IASTDeclSpecifier declSpec) {
|
||||||
|
if (hasAppendsOnly(declSpec)) {
|
||||||
|
handleAppends(declSpec);
|
||||||
|
}
|
||||||
|
return super.leave(declSpec);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int visit(IASTExpression expression) {
|
public int visit(IASTExpression expression) {
|
||||||
if (hasChangedChild(expression)) {
|
if (hasChangedChild(expression)) {
|
||||||
|
@ -383,13 +562,21 @@ public class ChangeGenerator extends ASTVisitor {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int visit(IASTStatement statement) {
|
public int visit(IASTStatement statement) {
|
||||||
if (hasChangedChild(statement)) {
|
if (hasChangedChild(statement) && !hasAppendsOnly(statement)) {
|
||||||
synthTreatment(statement);
|
synthTreatment(statement);
|
||||||
return ASTVisitor.PROCESS_SKIP;
|
return ASTVisitor.PROCESS_SKIP;
|
||||||
}
|
}
|
||||||
return super.visit(statement);
|
return super.visit(statement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int leave(IASTStatement statement) {
|
||||||
|
if (hasAppendsOnly(statement)) {
|
||||||
|
handleAppends(statement);
|
||||||
|
}
|
||||||
|
return super.leave(statement);
|
||||||
|
}
|
||||||
|
|
||||||
class CodeComparer {
|
class CodeComparer {
|
||||||
private final StringBuilder originalCode;
|
private final StringBuilder originalCode;
|
||||||
private final StringBuilder synthCode;
|
private final StringBuilder synthCode;
|
||||||
|
@ -536,14 +723,6 @@ public class ChangeGenerator extends ASTVisitor {
|
||||||
|
|
||||||
protected void createChange(MultiTextEdit edit, IASTNode changedNode) {
|
protected void createChange(MultiTextEdit edit, IASTNode changedNode) {
|
||||||
int changeOffset = getOffsetIncludingComments(changedNode);
|
int changeOffset = getOffsetIncludingComments(changedNode);
|
||||||
TextEditGroup editGroup = new TextEditGroup(Messages.ChangeGenerator_group);
|
|
||||||
for (ASTModification currentModification : modificationParent.get(changedNode)) {
|
|
||||||
if (currentModification.getAssociatedEditGroup() != null) {
|
|
||||||
editGroup = currentModification.getAssociatedEditGroup();
|
|
||||||
edit.addChildren(editGroup.getTextEdits());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
createChange(edit, changeOffset);
|
createChange(edit, changeOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,9 +11,9 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.rewrite.changegenerator;
|
package org.eclipse.cdt.internal.core.dom.rewrite.changegenerator;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.rewrite.astwriter.ASTWriterVisitor;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.astwriter.DeclSpecWriter;
|
import org.eclipse.cdt.internal.core.dom.rewrite.astwriter.DeclSpecWriter;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.astwriter.Scribe;
|
import org.eclipse.cdt.internal.core.dom.rewrite.astwriter.Scribe;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.NodeCommentMap;
|
import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.NodeCommentMap;
|
||||||
|
@ -21,8 +21,8 @@ import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.NodeCommentMap;
|
||||||
public class ModifiedASTDeclSpecWriter extends DeclSpecWriter {
|
public class ModifiedASTDeclSpecWriter extends DeclSpecWriter {
|
||||||
private final ASTModificationHelper modificationHelper;
|
private final ASTModificationHelper modificationHelper;
|
||||||
|
|
||||||
public ModifiedASTDeclSpecWriter(Scribe scribe, ASTVisitor visitor, ModificationScopeStack stack,
|
public ModifiedASTDeclSpecWriter(Scribe scribe, ASTWriterVisitor visitor,
|
||||||
NodeCommentMap commentMap) {
|
ModificationScopeStack stack, NodeCommentMap commentMap) {
|
||||||
super(scribe, visitor, commentMap);
|
super(scribe, visitor, commentMap);
|
||||||
this.modificationHelper = new ASTModificationHelper(stack);
|
this.modificationHelper = new ASTModificationHelper(stack);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,11 +12,11 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.rewrite.changegenerator;
|
package org.eclipse.cdt.internal.core.dom.rewrite.changegenerator;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTConstructorChainInitializer;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTConstructorChainInitializer;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDefinition;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDefinition;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceDefinition;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceDefinition;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.rewrite.astwriter.ASTWriterVisitor;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.astwriter.DeclarationWriter;
|
import org.eclipse.cdt.internal.core.dom.rewrite.astwriter.DeclarationWriter;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.astwriter.Scribe;
|
import org.eclipse.cdt.internal.core.dom.rewrite.astwriter.Scribe;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.NodeCommentMap;
|
import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.NodeCommentMap;
|
||||||
|
@ -24,21 +24,26 @@ import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.NodeCommentMap;
|
||||||
public class ModifiedASTDeclarationWriter extends DeclarationWriter {
|
public class ModifiedASTDeclarationWriter extends DeclarationWriter {
|
||||||
private final ASTModificationHelper modificationHelper;
|
private final ASTModificationHelper modificationHelper;
|
||||||
|
|
||||||
public ModifiedASTDeclarationWriter(Scribe scribe, ASTVisitor visitor, ModificationScopeStack stack, NodeCommentMap commentMap) {
|
public ModifiedASTDeclarationWriter(Scribe scribe, ASTWriterVisitor visitor,
|
||||||
|
ModificationScopeStack stack, NodeCommentMap commentMap) {
|
||||||
super(scribe, visitor, commentMap);
|
super(scribe, visitor, commentMap);
|
||||||
this.modificationHelper = new ASTModificationHelper(stack);
|
this.modificationHelper = new ASTModificationHelper(stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void writeDeclarationsInNamespace(ICPPASTNamespaceDefinition namespaceDefinition, IASTDeclaration[] declarations) {
|
protected void writeDeclarationsInNamespace(ICPPASTNamespaceDefinition namespaceDefinition,
|
||||||
IASTDeclaration[] modifiedDeclarations = modificationHelper.createModifiedChildArray(namespaceDefinition, declarations, IASTDeclaration.class, commentMap);
|
IASTDeclaration[] declarations) {
|
||||||
|
IASTDeclaration[] modifiedDeclarations = modificationHelper.createModifiedChildArray(
|
||||||
|
namespaceDefinition, declarations, IASTDeclaration.class, commentMap);
|
||||||
super.writeDeclarationsInNamespace(namespaceDefinition, modifiedDeclarations);
|
super.writeDeclarationsInNamespace(namespaceDefinition, modifiedDeclarations);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void writeCtorChainInitializer(ICPPASTFunctionDefinition funcDec,
|
protected void writeCtorChainInitializer(ICPPASTFunctionDefinition funcDec,
|
||||||
ICPPASTConstructorChainInitializer[] ctorInitChain) {
|
ICPPASTConstructorChainInitializer[] ctorInitChain) {
|
||||||
ICPPASTConstructorChainInitializer[] modifiedChainInitializer = modificationHelper.createModifiedChildArray(funcDec, ctorInitChain, ICPPASTConstructorChainInitializer.class, commentMap);
|
ICPPASTConstructorChainInitializer[] modifiedInitializer =
|
||||||
super.writeCtorChainInitializer(funcDec, modifiedChainInitializer);
|
modificationHelper.createModifiedChildArray(funcDec, ctorInitChain,
|
||||||
|
ICPPASTConstructorChainInitializer.class, commentMap);
|
||||||
|
super.writeCtorChainInitializer(funcDec, modifiedInitializer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.rewrite.changegenerator;
|
package org.eclipse.cdt.internal.core.dom.rewrite.changegenerator;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
|
import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
||||||
|
@ -25,6 +24,7 @@ import org.eclipse.cdt.core.dom.ast.IASTStandardFunctionDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.gnu.c.ICASTKnRFunctionDeclarator;
|
import org.eclipse.cdt.core.dom.ast.gnu.c.ICASTKnRFunctionDeclarator;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.rewrite.astwriter.ASTWriterVisitor;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.astwriter.DeclaratorWriter;
|
import org.eclipse.cdt.internal.core.dom.rewrite.astwriter.DeclaratorWriter;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.astwriter.Scribe;
|
import org.eclipse.cdt.internal.core.dom.rewrite.astwriter.Scribe;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.NodeCommentMap;
|
import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.NodeCommentMap;
|
||||||
|
@ -32,7 +32,7 @@ import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.NodeCommentMap;
|
||||||
public class ModifiedASTDeclaratorWriter extends DeclaratorWriter {
|
public class ModifiedASTDeclaratorWriter extends DeclaratorWriter {
|
||||||
private final ASTModificationHelper modificationHelper;
|
private final ASTModificationHelper modificationHelper;
|
||||||
|
|
||||||
public ModifiedASTDeclaratorWriter(Scribe scribe, ASTVisitor visitor, ModificationScopeStack stack, NodeCommentMap commentMap) {
|
public ModifiedASTDeclaratorWriter(Scribe scribe, ASTWriterVisitor visitor, ModificationScopeStack stack, NodeCommentMap commentMap) {
|
||||||
super(scribe, visitor, commentMap);
|
super(scribe, visitor, commentMap);
|
||||||
this.modificationHelper = new ASTModificationHelper(stack);
|
this.modificationHelper = new ASTModificationHelper(stack);
|
||||||
}
|
}
|
||||||
|
@ -40,29 +40,31 @@ public class ModifiedASTDeclaratorWriter extends DeclaratorWriter {
|
||||||
@Override
|
@Override
|
||||||
protected void writeParameterDeclarations(IASTStandardFunctionDeclarator funcDec,
|
protected void writeParameterDeclarations(IASTStandardFunctionDeclarator funcDec,
|
||||||
IASTParameterDeclaration[] paraDecls) {
|
IASTParameterDeclaration[] paraDecls) {
|
||||||
IASTParameterDeclaration[] modifiedParameters = modificationHelper
|
IASTParameterDeclaration[] modifiedParameters = modificationHelper.createModifiedChildArray(
|
||||||
.createModifiedChildArray(funcDec, paraDecls, IASTParameterDeclaration.class,
|
funcDec, paraDecls, IASTParameterDeclaration.class, commentMap);
|
||||||
commentMap);
|
|
||||||
super.writeParameterDeclarations(funcDec, modifiedParameters);
|
super.writeParameterDeclarations(funcDec, modifiedParameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void writePointerOperators(IASTDeclarator declarator,IASTPointerOperator[] unmodifiedPointerOperations) {
|
protected void writePointerOperators(IASTDeclarator declarator,
|
||||||
|
IASTPointerOperator[] unmodifiedPointerOperations) {
|
||||||
IASTPointerOperator[] modifiedPointer = modificationHelper.createModifiedChildArray(
|
IASTPointerOperator[] modifiedPointer = modificationHelper.createModifiedChildArray(
|
||||||
declarator, unmodifiedPointerOperations, IASTPointerOperator.class, commentMap);
|
declarator, unmodifiedPointerOperations, IASTPointerOperator.class, commentMap);
|
||||||
super.writePointerOperators(declarator, modifiedPointer);
|
super.writePointerOperators(declarator, modifiedPointer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void writeArrayModifiers(IASTArrayDeclarator arrDecl,
|
protected void writeArrayModifiers(IASTArrayDeclarator arrDecl, IASTArrayModifier[] arrMods) {
|
||||||
IASTArrayModifier[] arrMods) {
|
IASTArrayModifier[] modifiedModifiers = modificationHelper.createModifiedChildArray(arrDecl,
|
||||||
IASTArrayModifier[] modifiedModifiers = modificationHelper.createModifiedChildArray(arrDecl, arrMods, IASTArrayModifier.class, commentMap);
|
arrMods, IASTArrayModifier.class, commentMap);
|
||||||
super.writeArrayModifiers(arrDecl, modifiedModifiers);
|
super.writeArrayModifiers(arrDecl, modifiedModifiers);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void writeExceptionSpecification(ICPPASTFunctionDeclarator funcDec, IASTTypeId[] exceptions ) {
|
protected void writeExceptionSpecification(ICPPASTFunctionDeclarator funcDec,
|
||||||
IASTTypeId[] modifiedExceptions = modificationHelper.createModifiedChildArray(funcDec, exceptions, IASTTypeId.class, commentMap);
|
IASTTypeId[] exceptions) {
|
||||||
|
IASTTypeId[] modifiedExceptions = modificationHelper.createModifiedChildArray(funcDec,
|
||||||
|
exceptions, IASTTypeId.class, commentMap);
|
||||||
// it makes a difference whether the exception array is identical to
|
// it makes a difference whether the exception array is identical to
|
||||||
// ICPPASTFunctionDeclarator.NO_EXCEPTION_SPECIFICATION
|
// ICPPASTFunctionDeclarator.NO_EXCEPTION_SPECIFICATION
|
||||||
if (modifiedExceptions.length == 0 &&
|
if (modifiedExceptions.length == 0 &&
|
||||||
|
@ -74,18 +76,18 @@ public class ModifiedASTDeclaratorWriter extends DeclaratorWriter {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void writeKnRParameterDeclarations(
|
protected void writeKnRParameterDeclarations(ICASTKnRFunctionDeclarator knrFunct,
|
||||||
ICASTKnRFunctionDeclarator knrFunct,
|
|
||||||
IASTDeclaration[] knrDeclarations) {
|
IASTDeclaration[] knrDeclarations) {
|
||||||
IASTDeclaration[] modifiedDeclarations = modificationHelper.createModifiedChildArray(knrFunct, knrDeclarations, IASTDeclaration.class, commentMap);
|
IASTDeclaration[] modifiedDeclarations = modificationHelper.createModifiedChildArray(
|
||||||
|
knrFunct, knrDeclarations, IASTDeclaration.class, commentMap);
|
||||||
super.writeKnRParameterDeclarations(knrFunct, modifiedDeclarations);
|
super.writeKnRParameterDeclarations(knrFunct, modifiedDeclarations);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void writeKnRParameterNames(
|
protected void writeKnRParameterNames(ICASTKnRFunctionDeclarator knrFunct,
|
||||||
ICASTKnRFunctionDeclarator knrFunct, IASTName[] parameterNames) {
|
IASTName[] parameterNames) {
|
||||||
IASTName[] modifiedNames = modificationHelper.createModifiedChildArray(knrFunct, parameterNames, IASTName.class, commentMap);
|
IASTName[] modifiedNames = modificationHelper.createModifiedChildArray(knrFunct,
|
||||||
|
parameterNames, IASTName.class, commentMap);
|
||||||
super.writeKnRParameterNames(knrFunct, modifiedNames);
|
super.writeKnRParameterNames(knrFunct, modifiedNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.rewrite.changegenerator;
|
package org.eclipse.cdt.internal.core.dom.rewrite.changegenerator;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpressionList;
|
import org.eclipse.cdt.core.dom.ast.IASTExpressionList;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTInitializer;
|
import org.eclipse.cdt.core.dom.ast.IASTInitializer;
|
||||||
|
@ -20,6 +19,7 @@ import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNewExpression;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNewExpression;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification.ModificationKind;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification.ModificationKind;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.rewrite.astwriter.ASTWriterVisitor;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.astwriter.ExpressionWriter;
|
import org.eclipse.cdt.internal.core.dom.rewrite.astwriter.ExpressionWriter;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.astwriter.MacroExpansionHandler;
|
import org.eclipse.cdt.internal.core.dom.rewrite.astwriter.MacroExpansionHandler;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.astwriter.Scribe;
|
import org.eclipse.cdt.internal.core.dom.rewrite.astwriter.Scribe;
|
||||||
|
@ -28,7 +28,7 @@ import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.NodeCommentMap;
|
||||||
public class ModifiedASTExpressionWriter extends ExpressionWriter {
|
public class ModifiedASTExpressionWriter extends ExpressionWriter {
|
||||||
private final ASTModificationHelper modificationHelper;
|
private final ASTModificationHelper modificationHelper;
|
||||||
|
|
||||||
public ModifiedASTExpressionWriter(Scribe scribe, ASTVisitor visitor, MacroExpansionHandler macroHandler,
|
public ModifiedASTExpressionWriter(Scribe scribe, ASTWriterVisitor visitor, MacroExpansionHandler macroHandler,
|
||||||
ModificationScopeStack stack, NodeCommentMap commentMap) {
|
ModificationScopeStack stack, NodeCommentMap commentMap) {
|
||||||
super(scribe, visitor, macroHandler, commentMap);
|
super(scribe, visitor, macroHandler, commentMap);
|
||||||
this.modificationHelper = new ASTModificationHelper(stack);
|
this.modificationHelper = new ASTModificationHelper(stack);
|
||||||
|
|
|
@ -11,10 +11,10 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.rewrite.changegenerator;
|
package org.eclipse.cdt.internal.core.dom.rewrite.changegenerator;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTStatement;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.rewrite.astwriter.ASTWriterVisitor;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.astwriter.Scribe;
|
import org.eclipse.cdt.internal.core.dom.rewrite.astwriter.Scribe;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.astwriter.StatementWriter;
|
import org.eclipse.cdt.internal.core.dom.rewrite.astwriter.StatementWriter;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.NodeCommentMap;
|
import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.NodeCommentMap;
|
||||||
|
@ -22,7 +22,7 @@ import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.NodeCommentMap;
|
||||||
public class ModifiedASTStatementWriter extends StatementWriter {
|
public class ModifiedASTStatementWriter extends StatementWriter {
|
||||||
private final ASTModificationHelper modificationHelper;
|
private final ASTModificationHelper modificationHelper;
|
||||||
|
|
||||||
public ModifiedASTStatementWriter(Scribe scribe, ASTVisitor visitor, ModificationScopeStack stack, NodeCommentMap commentMap) {
|
public ModifiedASTStatementWriter(Scribe scribe, ASTWriterVisitor visitor, ModificationScopeStack stack, NodeCommentMap commentMap) {
|
||||||
super(scribe, visitor, commentMap);
|
super(scribe, visitor, commentMap);
|
||||||
this.modificationHelper = new ASTModificationHelper(stack);
|
this.modificationHelper = new ASTModificationHelper(stack);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,6 @@ void foo();
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
void foo()
|
void foo() {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,7 @@
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -20,8 +19,7 @@ public:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -36,21 +34,17 @@ public:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
return /*$*/42/*$$*/; //Hello
|
||||||
return /*$*/42/*$$*/; //Hallo
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void A::bar()
|
void A::bar() {
|
||||||
{
|
|
||||||
int a = 42;
|
int a = 42;
|
||||||
int b = 42;
|
int b = 42;
|
||||||
}
|
}
|
||||||
|
@ -58,21 +52,17 @@ void A::bar()
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
return theAnswer; //Hello
|
||||||
return theAnswer; //Hallo
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void A::bar()
|
void A::bar() {
|
||||||
{
|
|
||||||
int a = theAnswer;
|
int a = theAnswer;
|
||||||
int b = theAnswer;
|
int b = theAnswer;
|
||||||
}
|
}
|
||||||
|
@ -83,8 +73,7 @@ void A::bar()
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -99,8 +88,7 @@ public:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -115,22 +103,18 @@ public:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
//Hallo
|
//Hallo
|
||||||
return /*$*/42/*$$*/;
|
return /*$*/42/*$$*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
void A::bar()
|
void A::bar() {
|
||||||
{
|
|
||||||
int a = 42;
|
int a = 42;
|
||||||
int b = 42;
|
int b = 42;
|
||||||
}
|
}
|
||||||
|
@ -138,22 +122,18 @@ void A::bar()
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
//Hallo
|
//Hallo
|
||||||
return theAnswer;
|
return theAnswer;
|
||||||
}
|
}
|
||||||
|
|
||||||
void A::bar()
|
void A::bar() {
|
||||||
{
|
|
||||||
int a = theAnswer;
|
int a = theAnswer;
|
||||||
int b = theAnswer;
|
int b = theAnswer;
|
||||||
}
|
}
|
||||||
|
@ -164,8 +144,7 @@ void A::bar()
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -180,8 +159,7 @@ public:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -196,21 +174,17 @@ public:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float A::foo()
|
float A::foo() {
|
||||||
{
|
|
||||||
return /*$*/42.0f/*$$*/;
|
return /*$*/42.0f/*$$*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
void A::bar()
|
void A::bar() {
|
||||||
{
|
|
||||||
float a = 42.0f;
|
float a = 42.0f;
|
||||||
float b = 42.0f;
|
float b = 42.0f;
|
||||||
}
|
}
|
||||||
|
@ -218,21 +192,17 @@ void A::bar()
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float A::foo()
|
float A::foo() {
|
||||||
{
|
|
||||||
return theAnswer;
|
return theAnswer;
|
||||||
}
|
}
|
||||||
|
|
||||||
void A::bar()
|
void A::bar() {
|
||||||
{
|
|
||||||
float a = theAnswer;
|
float a = theAnswer;
|
||||||
float b = theAnswer;
|
float b = theAnswer;
|
||||||
}
|
}
|
||||||
|
@ -243,8 +213,7 @@ void A::bar()
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -259,8 +228,7 @@ public:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -275,21 +243,17 @@ public:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double A::foo()
|
double A::foo() {
|
||||||
{
|
|
||||||
return /*$*/42.0/*$$*/;
|
return /*$*/42.0/*$$*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
void A::bar()
|
void A::bar() {
|
||||||
{
|
|
||||||
double a = 42.0;
|
double a = 42.0;
|
||||||
double b = 42.0;
|
double b = 42.0;
|
||||||
}
|
}
|
||||||
|
@ -297,21 +261,17 @@ void A::bar()
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double A::foo()
|
double A::foo() {
|
||||||
{
|
|
||||||
return theAnswer;
|
return theAnswer;
|
||||||
}
|
}
|
||||||
|
|
||||||
void A::bar()
|
void A::bar() {
|
||||||
{
|
|
||||||
double a = theAnswer;
|
double a = theAnswer;
|
||||||
double b = theAnswer;
|
double b = theAnswer;
|
||||||
}
|
}
|
||||||
|
@ -322,8 +282,7 @@ void A::bar()
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -337,8 +296,7 @@ public:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -351,51 +309,43 @@ public:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
int bar()
|
int bar() {
|
||||||
{
|
|
||||||
return /*$*/42/*$$*/;
|
return /*$*/42/*$$*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
namespace
|
namespace {
|
||||||
{
|
|
||||||
const int theAnswer = 42;
|
const int theAnswer = 42;
|
||||||
}
|
|
||||||
A::A()
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
A::~A() {
|
||||||
{
|
}
|
||||||
|
|
||||||
|
int A::foo() {
|
||||||
return theAnswer;
|
return theAnswer;
|
||||||
}
|
}
|
||||||
|
|
||||||
int bar()
|
int bar() {
|
||||||
{
|
|
||||||
return theAnswer;
|
return theAnswer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!replaceNumberProtected
|
//!replaceNumberProtected
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.extractconstant.ExtractConstantRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.extractconstant.ExtractConstantRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -404,8 +354,7 @@ visibility=protected
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -418,12 +367,12 @@ public:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
int foo();
|
int foo();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static const int theAnswer = 42;
|
static const int theAnswer = 42;
|
||||||
};
|
};
|
||||||
|
@ -433,32 +382,26 @@ protected:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
return /*$*/42/*$$*/;
|
return /*$*/42/*$$*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
return theAnswer;
|
return theAnswer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -470,8 +413,7 @@ visibility=private
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -484,12 +426,12 @@ public:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
int foo();
|
int foo();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const int theAnswer = 42;
|
static const int theAnswer = 42;
|
||||||
};
|
};
|
||||||
|
@ -499,32 +441,26 @@ private:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
return /*$*/42/*$$*/;
|
return /*$*/42/*$$*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
return theAnswer;
|
return theAnswer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -535,14 +471,14 @@ filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
class X {
|
class X {
|
||||||
void method() {
|
void method() {
|
||||||
int a= /*$*/42/*$$*/;
|
int a = /*$*/42/*$$*/;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//=
|
//=
|
||||||
class X {
|
class X {
|
||||||
void method() {
|
void method() {
|
||||||
int a= theAnswer;
|
int a = theAnswer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -556,30 +492,26 @@ visibility=private
|
||||||
filename=A.h
|
filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
class X {
|
class X {
|
||||||
void method()
|
void method() {
|
||||||
{
|
char* a = /*$*/"sometext"/*$$*/;
|
||||||
char *a = /*$*/"sometext"/*$$*/;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void method2()
|
void method2() {
|
||||||
{
|
const char* b = "sometext";
|
||||||
const char *b = "sometext";
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//=
|
//=
|
||||||
class X {
|
class X {
|
||||||
void method()
|
void method() {
|
||||||
{
|
char* a = theAnswer;
|
||||||
char *a = theAnswer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void method2()
|
void method2() {
|
||||||
{
|
const char* b = theAnswer;
|
||||||
const char *b = theAnswer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *theAnswer = "sometext";
|
static const char* theAnswer = "sometext";
|
||||||
};
|
};
|
||||||
|
|
||||||
//!ExtractConstantWideString
|
//!ExtractConstantWideString
|
||||||
|
@ -589,31 +521,27 @@ visibility=private
|
||||||
filename=A.h
|
filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
class X {
|
class X {
|
||||||
void method()
|
void method() {
|
||||||
{
|
wchar_t* a = /*$*/L"sometext"/*$$*/;
|
||||||
wchar_t *a = /*$*/L"sometext"/*$$*/;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void method2()
|
void method2() {
|
||||||
{
|
const wchar_t* b = L"sometext";
|
||||||
const wchar_t *b = L"sometext";
|
const char* c = "sometext";
|
||||||
const char *c = "sometext";
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//=
|
//=
|
||||||
class X {
|
class X {
|
||||||
void method()
|
void method() {
|
||||||
{
|
wchar_t* a = theAnswer;
|
||||||
wchar_t *a = theAnswer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void method2()
|
void method2() {
|
||||||
{
|
const wchar_t* b = theAnswer;
|
||||||
const wchar_t *b = theAnswer;
|
const char* c = "sometext";
|
||||||
const char *c = "sometext";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const wchar_t *theAnswer = L"sometext";
|
static const wchar_t* theAnswer = L"sometext";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,7 @@
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -19,8 +18,7 @@ public:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -34,21 +32,17 @@ public:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
return 42; // Hello
|
||||||
return 42; //Hallo
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void A::bar()
|
void A::bar() {
|
||||||
{
|
|
||||||
int a = 42;
|
int a = 42;
|
||||||
int b = 42;
|
int b = 42;
|
||||||
}
|
}
|
||||||
|
@ -56,21 +50,17 @@ void A::bar()
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
return theAnswer; // Hello
|
||||||
return theAnswer; //Hallo
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void A::bar()
|
void A::bar() {
|
||||||
{
|
|
||||||
int a = theAnswer;
|
int a = theAnswer;
|
||||||
int b = theAnswer;
|
int b = theAnswer;
|
||||||
}
|
}
|
||||||
|
@ -91,8 +81,7 @@ project="RegressionTestProject" selection="64,2" visibility="public"/>
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -105,12 +94,12 @@ public:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
int foo();
|
int foo();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static const int theAnswer = 42;
|
static const int theAnswer = 42;
|
||||||
};
|
};
|
||||||
|
@ -120,32 +109,26 @@ protected:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
return theAnswer;
|
return theAnswer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,8 +147,7 @@ project="RegressionTestProject" selection="64,2" visibility="protected"/>
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -178,12 +160,12 @@ public:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
int foo();
|
int foo();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const int theAnswer = 42;
|
static const int theAnswer = 42;
|
||||||
};
|
};
|
||||||
|
@ -193,32 +175,26 @@ private:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
return theAnswer;
|
return theAnswer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,15 +6,13 @@ filename=test.cpp
|
||||||
methodname=check
|
methodname=check
|
||||||
|
|
||||||
//@test.h
|
//@test.h
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//=
|
//=
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
bool check();
|
bool check();
|
||||||
};
|
};
|
||||||
|
@ -23,9 +21,8 @@ class Test
|
||||||
//@test.cpp
|
//@test.cpp
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
if (/*$*/5 == 3 + 2/*$$*/) {
|
||||||
if(/*$*/5 == 3 + 2/*$$*/) {
|
|
||||||
//...
|
//...
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,14 +30,12 @@ void Test::test()
|
||||||
//=
|
//=
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
bool Test::check()
|
bool Test::check() {
|
||||||
{
|
|
||||||
return 5 == 3 + 2;
|
return 5 == 3 + 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
if (check()) {
|
||||||
if(check()) {
|
|
||||||
//...
|
//...
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,15 +48,13 @@ filename=test.cpp
|
||||||
methodname=check
|
methodname=check
|
||||||
|
|
||||||
//@test.h
|
//@test.h
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//=
|
//=
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
bool check(int num);
|
bool check(int num);
|
||||||
};
|
};
|
||||||
|
@ -70,10 +63,9 @@ class Test
|
||||||
//@test.cpp
|
//@test.cpp
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
|
||||||
int num = 1;
|
int num = 1;
|
||||||
if(/*$*/5 != 3 + num/*$$*/) {
|
if (/*$*/5 != 3 + num/*$$*/) {
|
||||||
//...
|
//...
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -81,15 +73,13 @@ void Test::test()
|
||||||
//=
|
//=
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
bool Test::check(int num)
|
bool Test::check(int num) {
|
||||||
{
|
|
||||||
return 5 != 3 + num;
|
return 5 != 3 + num;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
|
||||||
int num = 1;
|
int num = 1;
|
||||||
if(check(num)) {
|
if (check(num)) {
|
||||||
//...
|
//...
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,15 +92,13 @@ filename=test.cpp
|
||||||
methodname=add
|
methodname=add
|
||||||
|
|
||||||
//@test.h
|
//@test.h
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//=
|
//=
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
int add(int five, int six);
|
int add(int five, int six);
|
||||||
};
|
};
|
||||||
|
@ -119,8 +107,7 @@ class Test
|
||||||
//@test.cpp
|
//@test.cpp
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
|
||||||
int five = 5;
|
int five = 5;
|
||||||
int six = 6;
|
int six = 6;
|
||||||
int result = /*$*/five + six/*$$*/;
|
int result = /*$*/five + six/*$$*/;
|
||||||
|
@ -129,13 +116,11 @@ void Test::test()
|
||||||
//=
|
//=
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
int Test::add(int five, int six)
|
int Test::add(int five, int six) {
|
||||||
{
|
|
||||||
return five + six;
|
return five + six;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
|
||||||
int five = 5;
|
int five = 5;
|
||||||
int six = 6;
|
int six = 6;
|
||||||
int result = add(five, six);
|
int result = add(five, six);
|
||||||
|
@ -151,8 +136,7 @@ methodname=cat
|
||||||
//@test.h
|
//@test.h
|
||||||
struct helper {};
|
struct helper {};
|
||||||
|
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -160,8 +144,7 @@ class Test
|
||||||
//=
|
//=
|
||||||
struct helper {};
|
struct helper {};
|
||||||
|
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
helper cat(helper s1, helper s2);
|
helper cat(helper s1, helper s2);
|
||||||
};
|
};
|
||||||
|
@ -170,8 +153,7 @@ class Test
|
||||||
//@test.cpp
|
//@test.cpp
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
|
||||||
helper s1 = "a";
|
helper s1 = "a";
|
||||||
helper s2 = "b";
|
helper s2 = "b";
|
||||||
helper result = /*$*/s1 + s2/*$$*/;
|
helper result = /*$*/s1 + s2/*$$*/;
|
||||||
|
@ -180,13 +162,11 @@ void Test::test()
|
||||||
//=
|
//=
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
helper Test::cat(helper s1, helper s2)
|
helper Test::cat(helper s1, helper s2) {
|
||||||
{
|
|
||||||
return s1 + s2;
|
return s1 + s2;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
|
||||||
helper s1 = "a";
|
helper s1 = "a";
|
||||||
helper s2 = "b";
|
helper s2 = "b";
|
||||||
helper result = cat(s1, s2);
|
helper result = cat(s1, s2);
|
||||||
|
@ -203,8 +183,7 @@ methodname=cat
|
||||||
struct helper {};
|
struct helper {};
|
||||||
typedef helper new_helper;
|
typedef helper new_helper;
|
||||||
|
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -213,8 +192,7 @@ class Test
|
||||||
struct helper {};
|
struct helper {};
|
||||||
typedef helper new_helper;
|
typedef helper new_helper;
|
||||||
|
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
new_helper cat(new_helper s1, new_helper s2);
|
new_helper cat(new_helper s1, new_helper s2);
|
||||||
};
|
};
|
||||||
|
@ -223,8 +201,7 @@ class Test
|
||||||
//@test.cpp
|
//@test.cpp
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
|
||||||
new_helper s1 = "a";
|
new_helper s1 = "a";
|
||||||
new_helper s2 = "b";
|
new_helper s2 = "b";
|
||||||
new_helper result = /*$*/s1 + s2/*$$*/;
|
new_helper result = /*$*/s1 + s2/*$$*/;
|
||||||
|
@ -233,13 +210,11 @@ void Test::test()
|
||||||
//=
|
//=
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
new_helper Test::cat(new_helper s1, new_helper s2)
|
new_helper Test::cat(new_helper s1, new_helper s2) {
|
||||||
{
|
|
||||||
return s1 + s2;
|
return s1 + s2;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
|
||||||
new_helper s1 = "a";
|
new_helper s1 = "a";
|
||||||
new_helper s2 = "b";
|
new_helper s2 = "b";
|
||||||
new_helper result = cat(s1, s2);
|
new_helper result = cat(s1, s2);
|
||||||
|
@ -256,8 +231,7 @@ methodname=new_helper
|
||||||
|
|
||||||
struct helper {};
|
struct helper {};
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv) {
|
||||||
{
|
|
||||||
helper* h = /*$*/new helper/*$$*/;
|
helper* h = /*$*/new helper/*$$*/;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -265,13 +239,11 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
struct helper {};
|
struct helper {};
|
||||||
|
|
||||||
helper *new_helper()
|
helper* new_helper() {
|
||||||
{
|
|
||||||
return new helper;
|
return new helper;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv) {
|
||||||
{
|
|
||||||
helper* h = new_helper();
|
helper* h = new_helper();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -285,31 +257,26 @@ methodname=join_with_world
|
||||||
//@test.cpp
|
//@test.cpp
|
||||||
class string {};
|
class string {};
|
||||||
|
|
||||||
string join(string s1, char* s2)
|
string join(string s1, char* s2) {
|
||||||
{
|
|
||||||
return s1 + " " + s2;
|
return s1 + " " + s2;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
string hello = "Hello";
|
string hello = "Hello";
|
||||||
cout << /*$*/join(hello, "World")/*$$*/ << endl;
|
cout << /*$*/join(hello, "World")/*$$*/ << endl;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
class string {};
|
class string {};
|
||||||
|
|
||||||
string join(string s1, char* s2)
|
string join(string s1, char* s2) {
|
||||||
{
|
|
||||||
return s1 + " " + s2;
|
return s1 + " " + s2;
|
||||||
}
|
}
|
||||||
|
|
||||||
string join_with_world(string hello)
|
string join_with_world(string hello) {
|
||||||
{
|
|
||||||
return join(hello, "World");
|
return join(hello, "World");
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
string hello = "Hello";
|
string hello = "Hello";
|
||||||
cout << join_with_world(hello) << endl;
|
cout << join_with_world(hello) << endl;
|
||||||
}
|
}
|
||||||
|
@ -321,38 +288,34 @@ filename=test.cpp
|
||||||
methodname=value_from
|
methodname=value_from
|
||||||
|
|
||||||
//@test.cpp
|
//@test.cpp
|
||||||
struct other
|
struct other {
|
||||||
{
|
|
||||||
bool value() {}
|
bool value() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class Klass
|
class Klass {
|
||||||
{
|
void set(bool b) {
|
||||||
void set(bool b){}
|
}
|
||||||
void test()
|
|
||||||
{
|
void test() {
|
||||||
other o;
|
other o;
|
||||||
this->set(/*$*/o.value()/*$$*/);
|
this->set(/*$*/o.value()/*$$*/);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//=
|
//=
|
||||||
struct other
|
struct other {
|
||||||
{
|
|
||||||
bool value() {}
|
bool value() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class Klass
|
class Klass {
|
||||||
{
|
void set(bool b) {
|
||||||
void set(bool b){}
|
}
|
||||||
|
|
||||||
bool value_from(other o)
|
bool value_from(other o) {
|
||||||
{
|
|
||||||
return o.value();
|
return o.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
void test()
|
void test() {
|
||||||
{
|
|
||||||
other o;
|
other o;
|
||||||
this->set(value_from(o));
|
this->set(value_from(o));
|
||||||
}
|
}
|
||||||
|
@ -380,8 +343,7 @@ class Cursor{};
|
||||||
|
|
||||||
Cursor* contains(const Cursor& pos);
|
Cursor* contains(const Cursor& pos);
|
||||||
|
|
||||||
Cursor *has(Cursor c)
|
Cursor* has(Cursor c) {
|
||||||
{
|
|
||||||
return contains(c);
|
return contains(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -400,8 +362,7 @@ methodname=has
|
||||||
//@test.cpp
|
//@test.cpp
|
||||||
class Cursor{};
|
class Cursor{};
|
||||||
|
|
||||||
Cursor* contains(const Cursor& pos)
|
Cursor* contains(const Cursor& pos) {
|
||||||
{
|
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -413,13 +374,11 @@ int main() {
|
||||||
//=
|
//=
|
||||||
class Cursor{};
|
class Cursor{};
|
||||||
|
|
||||||
Cursor* contains(const Cursor& pos)
|
Cursor* contains(const Cursor& pos) {
|
||||||
{
|
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
Cursor *has(Cursor c)
|
Cursor* has(Cursor c) {
|
||||||
{
|
|
||||||
return contains(c);
|
return contains(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -436,15 +395,13 @@ filename=test.cpp
|
||||||
methodname=greeting
|
methodname=greeting
|
||||||
|
|
||||||
//@test.h
|
//@test.h
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//=
|
//=
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
const char greeting();
|
const char greeting();
|
||||||
};
|
};
|
||||||
|
@ -453,21 +410,18 @@ class Test
|
||||||
//@test.cpp
|
//@test.cpp
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
|
||||||
char* hi = /*$*/"hello"/*$$*/;
|
char* hi = /*$*/"hello"/*$$*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
const char Test::greeting()
|
const char Test::greeting() {
|
||||||
{
|
|
||||||
return "hello";
|
return "hello";
|
||||||
}
|
}
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
|
||||||
char* hi = greeting();
|
char* hi = greeting();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -479,15 +433,13 @@ filename=test.cpp
|
||||||
methodname=size
|
methodname=size
|
||||||
|
|
||||||
//@test.h
|
//@test.h
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//=
|
//=
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
int size();
|
int size();
|
||||||
};
|
};
|
||||||
|
@ -496,21 +448,18 @@ class Test
|
||||||
//@test.cpp
|
//@test.cpp
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
|
||||||
int i = /*$*/42/*$$*/;
|
int i = /*$*/42/*$$*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
int Test::size()
|
int Test::size() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
|
||||||
int i = size();
|
int i = size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -522,15 +471,13 @@ filename=test.cpp
|
||||||
methodname=certainty
|
methodname=certainty
|
||||||
|
|
||||||
//@test.h
|
//@test.h
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//=
|
//=
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
float certainty();
|
float certainty();
|
||||||
};
|
};
|
||||||
|
@ -539,21 +486,18 @@ class Test
|
||||||
//@test.cpp
|
//@test.cpp
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
|
||||||
float f = /*$*/0.42f/*$$*/;
|
float f = /*$*/0.42f/*$$*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
float Test::certainty()
|
float Test::certainty() {
|
||||||
{
|
|
||||||
return 0.42f;
|
return 0.42f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
|
||||||
float f = certainty();
|
float f = certainty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -565,15 +509,13 @@ filename=test.cpp
|
||||||
methodname=newline
|
methodname=newline
|
||||||
|
|
||||||
//@test.h
|
//@test.h
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//=
|
//=
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
char newline();
|
char newline();
|
||||||
};
|
};
|
||||||
|
@ -582,21 +524,18 @@ class Test
|
||||||
//@test.cpp
|
//@test.cpp
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
|
||||||
char nl = /*$*/'\n'/*$$*/;
|
char nl = /*$*/'\n'/*$$*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
char Test::newline()
|
char Test::newline() {
|
||||||
{
|
|
||||||
return '\n';
|
return '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
|
||||||
char nl = newline();
|
char nl = newline();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -608,15 +547,13 @@ filename=test.cpp
|
||||||
methodname=valid
|
methodname=valid
|
||||||
|
|
||||||
//@test.h
|
//@test.h
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//=
|
//=
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
bool valid();
|
bool valid();
|
||||||
};
|
};
|
||||||
|
@ -625,21 +562,18 @@ class Test
|
||||||
//@test.cpp
|
//@test.cpp
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
|
||||||
bool b = /*$*/true/*$$*/;
|
bool b = /*$*/true/*$$*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
bool Test::valid()
|
bool Test::valid() {
|
||||||
{
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
|
||||||
bool b = valid();
|
bool b = valid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -651,15 +585,13 @@ filename=test.cpp
|
||||||
methodname=invalid
|
methodname=invalid
|
||||||
|
|
||||||
//@test.h
|
//@test.h
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//=
|
//=
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
bool invalid();
|
bool invalid();
|
||||||
};
|
};
|
||||||
|
@ -668,21 +600,18 @@ class Test
|
||||||
//@test.cpp
|
//@test.cpp
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
|
||||||
bool b = /*$*/false/*$$*/;
|
bool b = /*$*/false/*$$*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
bool Test::invalid()
|
bool Test::invalid() {
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
|
||||||
bool b = invalid();
|
bool b = invalid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -694,15 +623,13 @@ filename=test.cpp
|
||||||
methodname=size
|
methodname=size
|
||||||
|
|
||||||
//@test.h
|
//@test.h
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//=
|
//=
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
int size();
|
int size();
|
||||||
};
|
};
|
||||||
|
@ -711,21 +638,18 @@ class Test
|
||||||
//@test.cpp
|
//@test.cpp
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
|
||||||
int i = /*$*/42/*$$*/;
|
int i = /*$*/42/*$$*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
int Test::size()
|
int Test::size() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
|
||||||
int i = size();
|
int i = size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -737,15 +661,13 @@ filename=test.cpp
|
||||||
methodname=newline
|
methodname=newline
|
||||||
|
|
||||||
//@test.h
|
//@test.h
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//=
|
//=
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
char newline();
|
char newline();
|
||||||
};
|
};
|
||||||
|
@ -754,21 +676,18 @@ class Test
|
||||||
//@test.cpp
|
//@test.cpp
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
|
||||||
char nl = /*$*/'\n'/*$$*/;
|
char nl = /*$*/'\n'/*$$*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
char Test::newline()
|
char Test::newline() {
|
||||||
{
|
|
||||||
return '\n';
|
return '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
|
||||||
char nl = newline();
|
char nl = newline();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -780,15 +699,13 @@ filename=test.cpp
|
||||||
methodname=valid
|
methodname=valid
|
||||||
|
|
||||||
//@test.h
|
//@test.h
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//=
|
//=
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
bool valid();
|
bool valid();
|
||||||
};
|
};
|
||||||
|
@ -797,21 +714,18 @@ class Test
|
||||||
//@test.cpp
|
//@test.cpp
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
|
||||||
bool b = /*$*/true/*$$*/;
|
bool b = /*$*/true/*$$*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
bool Test::valid()
|
bool Test::valid() {
|
||||||
{
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
|
||||||
bool b = valid();
|
bool b = valid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -823,15 +737,13 @@ filename=test.cpp
|
||||||
methodname=invalid
|
methodname=invalid
|
||||||
|
|
||||||
//@test.h
|
//@test.h
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//=
|
//=
|
||||||
class Test
|
class Test {
|
||||||
{
|
|
||||||
void test();
|
void test();
|
||||||
bool invalid();
|
bool invalid();
|
||||||
};
|
};
|
||||||
|
@ -840,21 +752,18 @@ class Test
|
||||||
//@test.cpp
|
//@test.cpp
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
|
||||||
bool b = /*$*/false/*$$*/;
|
bool b = /*$*/false/*$$*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
bool Test::invalid()
|
bool Test::invalid() {
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Test::test()
|
void Test::test() {
|
||||||
{
|
|
||||||
bool b = invalid();
|
bool b = invalid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -868,20 +777,19 @@ methodname=bar
|
||||||
//@test.cpp
|
//@test.cpp
|
||||||
typedef int& foo;
|
typedef int& foo;
|
||||||
int test(foo s) {
|
int test(foo s) {
|
||||||
int a= /*$*/s + 1/*$$*/; // type of id-expression 's' is int, not 'foo' or 'int&'
|
int a = /*$*/s + 1/*$$*/; // type of id-expression 's' is int, not 'foo' or 'int&'
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=
|
//=
|
||||||
typedef int& foo;
|
typedef int& foo;
|
||||||
int bar(foo s)
|
int bar(foo s) {
|
||||||
{
|
|
||||||
return s + 1;
|
return s + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int test(foo s) {
|
int test(foo s) {
|
||||||
int a= bar(s); // type of id-expression 's' is int, not 'foo' or 'int&'
|
int a = bar(s); // type of id-expression 's' is int, not 'foo' or 'int&'
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -895,19 +803,18 @@ methodname=bar
|
||||||
|
|
||||||
//@test.cpp
|
//@test.cpp
|
||||||
|
|
||||||
void foo(){
|
void foo() {
|
||||||
int x = 3;
|
int x = 3;
|
||||||
double y = /*$*/x + 2.5/*$$*/;
|
double y = /*$*/x + 2.5/*$$*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
|
|
||||||
double bar(int x)
|
double bar(int x) {
|
||||||
{
|
|
||||||
return x + 2.5;
|
return x + 2.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
void foo(){
|
void foo() {
|
||||||
int x = 3;
|
int x = 3;
|
||||||
double y = bar(x);
|
double y = bar(x);
|
||||||
}
|
}
|
||||||
|
@ -923,7 +830,7 @@ methodname=bar
|
||||||
#define five 5
|
#define five 5
|
||||||
#define ADD(a, b) a + b
|
#define ADD(a, b) a + b
|
||||||
|
|
||||||
int main(){
|
int main() {
|
||||||
int i = five; //comment3
|
int i = five; //comment3
|
||||||
i = /*$*/ADD(i, five)/*$$*/;
|
i = /*$*/ADD(i, five)/*$$*/;
|
||||||
|
|
||||||
|
@ -934,12 +841,11 @@ int main(){
|
||||||
#define five 5
|
#define five 5
|
||||||
#define ADD(a, b) a + b
|
#define ADD(a, b) a + b
|
||||||
|
|
||||||
int bar(int & i)
|
int bar(int& i) {
|
||||||
{
|
|
||||||
return ADD(i, five);
|
return ADD(i, five);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(){
|
int main() {
|
||||||
int i = five; //comment3
|
int i = five; //comment3
|
||||||
i = bar(i);
|
i = bar(i);
|
||||||
|
|
||||||
|
@ -957,7 +863,7 @@ methodname=bar
|
||||||
#define five 5
|
#define five 5
|
||||||
#define ADD(a, b) a + b
|
#define ADD(a, b) a + b
|
||||||
|
|
||||||
int main(){
|
int main() {
|
||||||
int i = five; //comment3
|
int i = five; //comment3
|
||||||
i = /*$*/ADD(i, five)/*$$*/;
|
i = /*$*/ADD(i, five)/*$$*/;
|
||||||
|
|
||||||
|
@ -968,12 +874,11 @@ int main(){
|
||||||
#define five 5
|
#define five 5
|
||||||
#define ADD(a, b) a + b
|
#define ADD(a, b) a + b
|
||||||
|
|
||||||
int bar(int & i)
|
int bar(int& i) {
|
||||||
{
|
|
||||||
return ADD(i, five);
|
return ADD(i, five);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(){
|
int main() {
|
||||||
int i = five; //comment3
|
int i = five; //comment3
|
||||||
i = bar(i);
|
i = bar(i);
|
||||||
|
|
||||||
|
|
|
@ -1,31 +1,31 @@
|
||||||
//!Extract template function
|
//!Extract template function
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
void test(){
|
void test() {
|
||||||
}
|
}
|
||||||
template <typename T>
|
|
||||||
int tempFunct(){
|
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
int tempFunct() {
|
||||||
T i;
|
T i;
|
||||||
i = 0;
|
i = 0;
|
||||||
/*$*/i++;
|
/*$*/i++;
|
||||||
i+=3;/*$$*/
|
i += 3;/*$$*/
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
void test(){
|
void test() {
|
||||||
}
|
}
|
||||||
template<typename T> void exp(T i)
|
|
||||||
{
|
template<typename T>
|
||||||
|
void exp(T i) {
|
||||||
i++;
|
i++;
|
||||||
i += 3;
|
i += 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
int tempFunct(){
|
int tempFunct() {
|
||||||
|
|
||||||
T i;
|
T i;
|
||||||
i = 0;
|
i = 0;
|
||||||
exp(i);
|
exp(i);
|
||||||
|
@ -36,27 +36,28 @@ int tempFunct(){
|
||||||
//!Extract template function with template parameter Bug #12
|
//!Extract template function with template parameter Bug #12
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
void test(){
|
void test() {
|
||||||
}
|
}
|
||||||
template <typename T>
|
|
||||||
int tempFunct(T p){
|
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
int tempFunct(T p) {
|
||||||
/*$*/++p;
|
/*$*/++p;
|
||||||
p + 4;/*$$*/
|
p + 4;/*$$*/
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
void test(){
|
void test() {
|
||||||
}
|
}
|
||||||
template<typename T> void exp(T p)
|
|
||||||
{
|
template<typename T>
|
||||||
|
void exp(T p) {
|
||||||
++p;
|
++p;
|
||||||
p + 4;
|
p + 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
int tempFunct(T p){
|
int tempFunct(T p) {
|
||||||
exp(p);
|
exp(p);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -64,11 +65,11 @@ int tempFunct(T p){
|
||||||
//!Extract template function with template type declaration Bug #11
|
//!Extract template function with template type declaration Bug #11
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
void test(){
|
void test() {
|
||||||
}
|
}
|
||||||
template <typename T>
|
|
||||||
int tempFunct(){
|
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
int tempFunct() {
|
||||||
/*$*/T p;
|
/*$*/T p;
|
||||||
p = 0;
|
p = 0;
|
||||||
p + 4;/*$$*/
|
p + 4;/*$$*/
|
||||||
|
@ -77,10 +78,11 @@ int tempFunct(){
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
void test(){
|
void test() {
|
||||||
}
|
}
|
||||||
template<typename T> T exp()
|
|
||||||
{
|
template<typename T>
|
||||||
|
T exp() {
|
||||||
T p;
|
T p;
|
||||||
p = 0;
|
p = 0;
|
||||||
p + 4;
|
p + 4;
|
||||||
|
@ -88,8 +90,7 @@ template<typename T> T exp()
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
int tempFunct(){
|
int tempFunct() {
|
||||||
|
|
||||||
T p = exp();
|
T p = exp();
|
||||||
p + 2;
|
p + 2;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -4,8 +4,7 @@
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -18,8 +17,7 @@ public:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -31,32 +29,26 @@ public:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
return /*$*/42/*$$*/;
|
return /*$*/42/*$$*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
int i = 42;
|
int i = 42;
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
@ -67,8 +59,7 @@ int A::foo()
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -81,8 +72,7 @@ public:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -94,32 +84,26 @@ public:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
return /*$*/'c'/*$$*/;
|
return /*$*/'c'/*$$*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
char temp = 'c';
|
char temp = 'c';
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
@ -130,8 +114,7 @@ int A::foo()
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -144,8 +127,7 @@ public:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -157,32 +139,26 @@ public:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float A::foo()
|
float A::foo() {
|
||||||
{
|
|
||||||
return /*$*/42.0f/*$$*/;
|
return /*$*/42.0f/*$$*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float A::foo()
|
float A::foo() {
|
||||||
{
|
|
||||||
float f = 42.0f;
|
float f = 42.0f;
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
@ -193,8 +169,7 @@ float A::foo()
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -207,8 +182,7 @@ public:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -220,32 +194,26 @@ public:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float A::foo()
|
float A::foo() {
|
||||||
{
|
|
||||||
return /*$*/42.0/*$$*/;
|
return /*$*/42.0/*$$*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float A::foo()
|
float A::foo() {
|
||||||
{
|
|
||||||
double f = 42.0;
|
double f = 42.0;
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
@ -256,8 +224,7 @@ float A::foo()
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -270,8 +237,7 @@ public:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -283,32 +249,26 @@ public:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
return /*$*/(42)/*$$*/;
|
return /*$*/(42)/*$$*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
int i = 42;
|
int i = 42;
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
@ -319,8 +279,7 @@ int A::foo()
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -333,8 +292,7 @@ public:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -346,16 +304,13 @@ public:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
int x = 3;
|
int x = 3;
|
||||||
return /*$*/(x + 2)/*$$*/ * 15;
|
return /*$*/(x + 2)/*$$*/ * 15;
|
||||||
}
|
}
|
||||||
|
@ -363,16 +318,13 @@ int A::foo()
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
int x = 3;
|
int x = 3;
|
||||||
int i = x + 2;
|
int i = x + 2;
|
||||||
return i * 15;
|
return i * 15;
|
||||||
|
@ -381,27 +333,29 @@ int A::foo()
|
||||||
//!Bug #277065 extract local variable fails to extract from for loop
|
//!Bug #277065 extract local variable fails to extract from for loop
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.extractlocalvariable.ExtractLocalVariableRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.extractlocalvariable.ExtractLocalVariableRefactoringTest
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
void foo(){
|
void foo() {
|
||||||
for(int n = /*$*/5 + 2/*$$*/; n < 10; ++n);
|
for (int n = /*$*/5 + 2/*$$*/; n < 10; ++n)
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
void foo(){
|
void foo() {
|
||||||
int i = 5 + 2;
|
int i = 5 + 2;
|
||||||
for(int n = i; n < 10; ++n);
|
for (int n = i; n < 10; ++n)
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
//!ExtractLocalVariableRefactoringTest expression
|
//!ExtractLocalVariableRefactoringTest expression
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.extractlocalvariable.ExtractLocalVariableRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.extractlocalvariable.ExtractLocalVariableRefactoringTest
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
void foo(){
|
void foo() {
|
||||||
int a = 0;
|
int a = 0;
|
||||||
float b = 0.1f;
|
float b = 0.1f;
|
||||||
double c = /*$*/(a + b)/*$$*/ * 0.2;
|
double c = /*$*/(a + b)/*$$*/ * 0.2;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
void foo(){
|
void foo() {
|
||||||
int a = 0;
|
int a = 0;
|
||||||
float b = 0.1f;
|
float b = 0.1f;
|
||||||
float a0 = a + b;
|
float a0 = a + b;
|
||||||
|
@ -411,30 +365,32 @@ void foo(){
|
||||||
//!ExtractLocalVariableRefactoringTest pointer
|
//!ExtractLocalVariableRefactoringTest pointer
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.extractlocalvariable.ExtractLocalVariableRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.extractlocalvariable.ExtractLocalVariableRefactoringTest
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
void foo(){
|
void foo() {
|
||||||
int a[2];
|
int a[2];
|
||||||
int b = */*$*/(a + 1)/*$$*/;
|
int b = */*$*/(a + 1)/*$$*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
void foo(){
|
void foo() {
|
||||||
int a[2];
|
int a[2];
|
||||||
int *i = a + 1;
|
int* i = a + 1;
|
||||||
int b = *i;
|
int b = *i;
|
||||||
}
|
}
|
||||||
|
|
||||||
//!ExtractLocalVariableRefactoringTest qualifiers
|
//!ExtractLocalVariableRefactoringTest qualifiers
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.extractlocalvariable.ExtractLocalVariableRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.extractlocalvariable.ExtractLocalVariableRefactoringTest
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
const volatile int *k;
|
const volatile int* k;
|
||||||
void foo(){
|
|
||||||
|
void foo() {
|
||||||
/*$*/k;/*$$*/
|
/*$*/k;/*$$*/
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
const volatile int *k;
|
const volatile int* k;
|
||||||
void foo(){
|
|
||||||
const volatile int *k0 = k;
|
void foo() {
|
||||||
|
const volatile int* k0 = k;
|
||||||
k0;
|
k0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -443,10 +399,10 @@ void foo(){
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
class K {
|
class K {
|
||||||
public:
|
public:
|
||||||
bool operator+(int b) {return true;}
|
bool operator+(int b) { return true; }
|
||||||
float operator+(unsigned u) {return 1.0f;}
|
float operator+(unsigned u) { return 1.0f; }
|
||||||
};
|
};
|
||||||
void foo(){
|
void foo() {
|
||||||
K k;
|
K k;
|
||||||
/*$*/k+3u/*$$*/;
|
/*$*/k+3u/*$$*/;
|
||||||
}
|
}
|
||||||
|
@ -454,10 +410,10 @@ void foo(){
|
||||||
//=
|
//=
|
||||||
class K {
|
class K {
|
||||||
public:
|
public:
|
||||||
bool operator+(int b) {return true;}
|
bool operator+(int b) { return true; }
|
||||||
float operator+(unsigned u) {return 1.0f;}
|
float operator+(unsigned u) { return 1.0f; }
|
||||||
};
|
};
|
||||||
void foo(){
|
void foo() {
|
||||||
K k;
|
K k;
|
||||||
float i = k + 3u;
|
float i = k + 3u;
|
||||||
i;
|
i;
|
||||||
|
@ -468,15 +424,15 @@ void foo(){
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
|
|
||||||
void func() {
|
void func() {
|
||||||
int *(*a)[2];
|
int* (*a)[2];
|
||||||
/*$*/a/*$$*/;
|
/*$*/a/*$$*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
|
|
||||||
void func() {
|
void func() {
|
||||||
int *(*a)[2];
|
int* (*a)[2];
|
||||||
int *(*a0)[2] = a;
|
int* (*a0)[2] = a;
|
||||||
a0;
|
a0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -491,9 +447,7 @@ class Foo {
|
||||||
Foo<int> getFoo();
|
Foo<int> getFoo();
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
|
||||||
/*$*/getFoo()/*$$*/;
|
/*$*/getFoo()/*$$*/;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -508,33 +462,34 @@ Foo<int> getFoo();
|
||||||
int main() {
|
int main() {
|
||||||
Foo<int> foo = getFoo();
|
Foo<int> foo = getFoo();
|
||||||
foo;
|
foo;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//!Bug 331963 Extract local variable doesn't put template type parameters Namespace
|
//!Bug 331963 Extract local variable doesn't put template type parameters Namespace
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.extractlocalvariable.ExtractLocalVariableRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.extractlocalvariable.ExtractLocalVariableRefactoringTest
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
namespace bar{
|
namespace bar {
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
class Foo {
|
class Foo {
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bar::Foo<int> getFoo();
|
bar::Foo<int> getFoo();
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
|
||||||
/*$*/getFoo()/*$$*/;
|
/*$*/getFoo()/*$$*/;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
namespace bar{
|
namespace bar {
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
class Foo {
|
class Foo {
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bar::Foo<int> getFoo();
|
bar::Foo<int> getFoo();
|
||||||
|
@ -542,7 +497,6 @@ bar::Foo<int> getFoo();
|
||||||
int main() {
|
int main() {
|
||||||
bar::Foo<int> foo = getFoo();
|
bar::Foo<int> foo = getFoo();
|
||||||
foo;
|
foo;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -550,22 +504,22 @@ int main() {
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.extractlocalvariable.ExtractLocalVariableRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.extractlocalvariable.ExtractLocalVariableRefactoringTest
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
|
|
||||||
struct Foo{
|
struct Foo {
|
||||||
int getVarWithLongName();
|
int getVarWithLongName();
|
||||||
};
|
};
|
||||||
|
|
||||||
void bar(){
|
void bar() {
|
||||||
Foo f;
|
Foo f;
|
||||||
/*$*/f.getVarWithLongName()/*$$*/;
|
/*$*/f.getVarWithLongName()/*$$*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
|
|
||||||
struct Foo{
|
struct Foo {
|
||||||
int getVarWithLongName();
|
int getVarWithLongName();
|
||||||
};
|
};
|
||||||
|
|
||||||
void bar(){
|
void bar() {
|
||||||
Foo f;
|
Foo f;
|
||||||
int varWithLongName = f.getVarWithLongName();
|
int varWithLongName = f.getVarWithLongName();
|
||||||
varWithLongName;
|
varWithLongName;
|
||||||
|
@ -575,22 +529,22 @@ void bar(){
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.extractlocalvariable.ExtractLocalVariableRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.extractlocalvariable.ExtractLocalVariableRefactoringTest
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
|
|
||||||
struct Foo{
|
struct Foo {
|
||||||
int get();
|
int get();
|
||||||
};
|
};
|
||||||
|
|
||||||
void bar(){
|
void bar() {
|
||||||
Foo f;
|
Foo f;
|
||||||
/*$*/f.get()/*$$*/;
|
/*$*/f.get()/*$$*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
|
|
||||||
struct Foo{
|
struct Foo {
|
||||||
int get();
|
int get();
|
||||||
};
|
};
|
||||||
|
|
||||||
void bar(){
|
void bar() {
|
||||||
Foo f;
|
Foo f;
|
||||||
int get = f.get();
|
int get = f.get();
|
||||||
get;
|
get;
|
||||||
|
@ -600,29 +554,29 @@ void bar(){
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.extractlocalvariable.ExtractLocalVariableRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.extractlocalvariable.ExtractLocalVariableRefactoringTest
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
|
|
||||||
int getA(){
|
int getA() {
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
int getB(int a){
|
int getB(int a) {
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
void bar(){
|
void bar() {
|
||||||
/*$*/getB(getA())/*$$*/;
|
/*$*/getB(getA())/*$$*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
|
|
||||||
int getA(){
|
int getA() {
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
int getB(int a){
|
int getB(int a) {
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
void bar(){
|
void bar() {
|
||||||
int b = getB(getA());
|
int b = getB(getA());
|
||||||
b;
|
b;
|
||||||
}
|
}
|
||||||
|
@ -631,37 +585,37 @@ void bar(){
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.extractlocalvariable.ExtractLocalVariableRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.extractlocalvariable.ExtractLocalVariableRefactoringTest
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
|
|
||||||
int getA(){
|
int getA() {
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
int getB(int a){
|
int getB(int a) {
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
int getC(int a){
|
int getC(int a) {
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
void bar(){
|
void bar() {
|
||||||
getB(/*$*/getC(getA())/*$$*/);
|
getB(/*$*/getC(getA())/*$$*/);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
|
|
||||||
int getA(){
|
int getA() {
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
int getB(int a){
|
int getB(int a) {
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
int getC(int a){
|
int getC(int a) {
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
void bar(){
|
void bar() {
|
||||||
int c = getC(getA());
|
int c = getC(getA());
|
||||||
getB(c);
|
getB(c);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
//!extract local variable from for loop
|
//!extract local variable from for loop
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.RefactoringHistoryTest
|
//#org.eclipse.cdt.ui.tests.refactoring.RefactoringHistoryTest
|
||||||
//@main.cpp
|
//@main.cpp
|
||||||
void foo(){
|
void foo() {
|
||||||
for(int n = 5 + 2; n < 10; ++n);
|
for (int n = 5 + 2; n < 10; ++n)
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
void foo(){
|
void foo() {
|
||||||
int i = 5 + 2;
|
int i = 5 + 2;
|
||||||
for(int n = i; n < 10; ++n);
|
for (int n = i; n < 10; ++n)
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
//@refScript.xml
|
//@refScript.xml
|
||||||
|
@ -17,5 +19,5 @@ void foo(){
|
||||||
<refactoring comment="Extract 5 + 2" description="Extract Local Variable Refactoring"
|
<refactoring comment="Extract 5 + 2" description="Extract Local Variable Refactoring"
|
||||||
fileName="file:$$projectPath$$/main.cpp" flags="4"
|
fileName="file:$$projectPath$$/main.cpp" flags="4"
|
||||||
id="org.eclipse.cdt.internal.ui.refactoring.extractlocalvariable.ExtractLocalVariableRefactoring"
|
id="org.eclipse.cdt.internal.ui.refactoring.extractlocalvariable.ExtractLocalVariableRefactoring"
|
||||||
name="i" project="RegressionTestProject" selection="25,5"/>
|
name="i" project="RegressionTestProject" selection="27,5"/>
|
||||||
</session>
|
</session>
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -6,8 +6,7 @@ replaceduplicates=true
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -23,8 +22,7 @@ private:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -32,7 +30,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int help();
|
int help();
|
||||||
void exp(int & i);
|
void exp(int& i);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /*A_H_*/
|
#endif /*A_H_*/
|
||||||
|
@ -40,54 +38,49 @@ private:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
int i = 2;
|
int i = 2;
|
||||||
++i;
|
++i;
|
||||||
help();
|
help();
|
||||||
}int A::foo()
|
}
|
||||||
{
|
|
||||||
|
int A::foo() {
|
||||||
int i = 2;
|
int i = 2;
|
||||||
/*$*/++i;
|
/*$*/++i;
|
||||||
help();/*$$*/
|
help();/*$$*/
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
int i = 2;
|
int i = 2;
|
||||||
exp(i);
|
exp(i);
|
||||||
}void A::exp(int & i)
|
}
|
||||||
{
|
|
||||||
|
void A::exp(int& i) {
|
||||||
++i;
|
++i;
|
||||||
help();
|
help();
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
int i = 2;
|
int i = 2;
|
||||||
exp(i);
|
exp(i);
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,8 +92,7 @@ replaceduplicates=true
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -116,8 +108,7 @@ private:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -125,7 +116,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int help();
|
int help();
|
||||||
void exp(int & i);
|
void exp(int& i);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /*A_H_*/
|
#endif /*A_H_*/
|
||||||
|
@ -133,54 +124,49 @@ private:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
int oo = 99;
|
int oo = 99;
|
||||||
++oo;
|
++oo;
|
||||||
help();
|
help();
|
||||||
}int A::foo()
|
}
|
||||||
{
|
|
||||||
|
int A::foo() {
|
||||||
int i = 2;
|
int i = 2;
|
||||||
/*$*/++i;
|
/*$*/++i;
|
||||||
help();/*$$*/
|
help();/*$$*/
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
int oo = 99;
|
int oo = 99;
|
||||||
exp(oo);
|
exp(oo);
|
||||||
}void A::exp(int & i)
|
}
|
||||||
{
|
|
||||||
|
void A::exp(int& i) {
|
||||||
++i;
|
++i;
|
||||||
help();
|
help();
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
int i = 2;
|
int i = 2;
|
||||||
exp(i);
|
exp(i);
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -193,8 +179,7 @@ returnvalue=true
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -211,8 +196,7 @@ private:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -221,7 +205,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int help();
|
int help();
|
||||||
int exp(int j, int & a);
|
int exp(int j, int& a);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /*A_H_*/
|
#endif /*A_H_*/
|
||||||
|
@ -229,18 +213,17 @@ private:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
int j = 0;
|
int j = 0;
|
||||||
i++;
|
i++;
|
||||||
j++;
|
j++;
|
||||||
help();
|
help();
|
||||||
}void A::foo()
|
}
|
||||||
{
|
|
||||||
|
void A::foo() {
|
||||||
int j = 0;
|
int j = 0;
|
||||||
int a = 1;
|
int a = 1;
|
||||||
/*$*/j++;
|
/*$*/j++;
|
||||||
|
@ -250,32 +233,29 @@ A::~A()
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
int j = 0;
|
int j = 0;
|
||||||
i = exp(i, j);
|
i = exp(i, j);
|
||||||
}int A::exp(int j, int & a)
|
}
|
||||||
{
|
|
||||||
|
int A::exp(int j, int& a) {
|
||||||
j++;
|
j++;
|
||||||
a++;
|
a++;
|
||||||
help();
|
help();
|
||||||
return j;
|
return j;
|
||||||
}
|
}
|
||||||
|
|
||||||
void A::foo()
|
void A::foo() {
|
||||||
{
|
|
||||||
int j = 0;
|
int j = 0;
|
||||||
int a = 1;
|
int a = 1;
|
||||||
j = exp(j, a);
|
j = exp(j, a);
|
||||||
|
@ -283,8 +263,7 @@ void A::foo()
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -297,8 +276,7 @@ returnvalue=true
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -316,8 +294,7 @@ private:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -335,19 +312,18 @@ private:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
int j = 0;
|
int j = 0;
|
||||||
int a = 1;
|
int a = 1;
|
||||||
a++;
|
a++;
|
||||||
j++;
|
j++;
|
||||||
help();
|
help();
|
||||||
}void A::foo()
|
}
|
||||||
{
|
|
||||||
|
void A::foo() {
|
||||||
int j = 0;
|
int j = 0;
|
||||||
|
|
||||||
/*$*/field++;
|
/*$*/field++;
|
||||||
|
@ -357,43 +333,39 @@ A::~A()
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
int j = 0;
|
int j = 0;
|
||||||
int a = 1;
|
int a = 1;
|
||||||
a++;
|
a++;
|
||||||
j++;
|
j++;
|
||||||
help();
|
help();
|
||||||
}int A::exp(int j)
|
}
|
||||||
{
|
|
||||||
|
int A::exp(int j) {
|
||||||
field++;
|
field++;
|
||||||
j++;
|
j++;
|
||||||
help();
|
help();
|
||||||
return j;
|
return j;
|
||||||
}
|
}
|
||||||
|
|
||||||
void A::foo()
|
void A::foo() {
|
||||||
{
|
|
||||||
int j = 0;
|
int j = 0;
|
||||||
j = exp(j);
|
j = exp(j);
|
||||||
field++;
|
field++;
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -406,8 +378,7 @@ returnvalue=true
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -423,8 +394,7 @@ private:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -432,7 +402,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int help();
|
int help();
|
||||||
int exp(int i, float & j);
|
int exp(int i, float& j);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /*A_H_*/
|
#endif /*A_H_*/
|
||||||
|
@ -440,20 +410,19 @@ private:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
int oo = 99;
|
int oo = 99;
|
||||||
float blabla = 0;
|
float blabla = 0;
|
||||||
++oo;
|
++oo;
|
||||||
blabla += 1;
|
blabla += 1;
|
||||||
help();
|
help();
|
||||||
blabla += 1;
|
blabla += 1;
|
||||||
}int A::foo()
|
}
|
||||||
{
|
|
||||||
|
int A::foo() {
|
||||||
int i = 2;
|
int i = 2;
|
||||||
float j = 8989;
|
float j = 8989;
|
||||||
/*$*/++i;
|
/*$*/++i;
|
||||||
|
@ -463,34 +432,31 @@ A::~A()
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
int oo = 99;
|
int oo = 99;
|
||||||
float blabla = 0;
|
float blabla = 0;
|
||||||
oo = exp(oo, blabla);
|
oo = exp(oo, blabla);
|
||||||
blabla += 1;
|
blabla += 1;
|
||||||
}int A::exp(int i, float & j)
|
}
|
||||||
{
|
|
||||||
|
int A::exp(int i, float& j) {
|
||||||
++i;
|
++i;
|
||||||
j += 1;
|
j += 1;
|
||||||
help();
|
help();
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
int i = 2;
|
int i = 2;
|
||||||
float j = 8989;
|
float j = 8989;
|
||||||
i = exp(i, j);
|
i = exp(i, j);
|
||||||
|
@ -498,8 +464,7 @@ int A::foo()
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -511,8 +476,7 @@ replaceduplicates=true
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -528,8 +492,7 @@ private:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -537,7 +500,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int help();
|
int help();
|
||||||
void exp(int & i, float j);
|
void exp(int& i, float j);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /*A_H_*/
|
#endif /*A_H_*/
|
||||||
|
@ -545,19 +508,18 @@ private:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
int oo = 99;
|
int oo = 99;
|
||||||
float blabla = 0;
|
float blabla = 0;
|
||||||
++oo;
|
++oo;
|
||||||
blabla += 1;
|
blabla += 1;
|
||||||
help();
|
help();
|
||||||
}int A::foo()
|
}
|
||||||
{
|
|
||||||
|
int A::foo() {
|
||||||
int i = 2;
|
int i = 2;
|
||||||
float j = 8989;
|
float j = 8989;
|
||||||
/*$*/++i;
|
/*$*/++i;
|
||||||
|
@ -566,40 +528,36 @@ A::~A()
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
int oo = 99;
|
int oo = 99;
|
||||||
float blabla = 0;
|
float blabla = 0;
|
||||||
exp(oo, blabla);
|
exp(oo, blabla);
|
||||||
}void A::exp(int & i, float j)
|
}
|
||||||
{
|
|
||||||
|
void A::exp(int& i, float j) {
|
||||||
++i;
|
++i;
|
||||||
j += 1;
|
j += 1;
|
||||||
help();
|
help();
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
int i = 2;
|
int i = 2;
|
||||||
float j = 8989;
|
float j = 8989;
|
||||||
exp(i, j);
|
exp(i, j);
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -611,8 +569,7 @@ replaceduplicates=true
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -628,8 +585,7 @@ private:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -645,55 +601,50 @@ private:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
int i = 2;
|
int i = 2;
|
||||||
++i;// No Duplicate
|
++i;// No Duplicate
|
||||||
help();
|
help();
|
||||||
++i;// this is the reason
|
++i;// this is the reason
|
||||||
}void A::foo()
|
}
|
||||||
{
|
|
||||||
|
void A::foo() {
|
||||||
int i = 2;
|
int i = 2;
|
||||||
/*$*/++i;
|
/*$*/++i;
|
||||||
help();/*$$*/
|
help();/*$$*/
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
int i = 2;
|
int i = 2;
|
||||||
++i;// No Duplicate
|
++i;// No Duplicate
|
||||||
help();
|
help();
|
||||||
++i;// this is the reason
|
++i;// this is the reason
|
||||||
}void A::exp(int i)
|
}
|
||||||
{
|
|
||||||
|
void A::exp(int i) {
|
||||||
++i;
|
++i;
|
||||||
help();
|
help();
|
||||||
}
|
}
|
||||||
|
|
||||||
void A::foo()
|
void A::foo() {
|
||||||
{
|
|
||||||
int i = 2;
|
int i = 2;
|
||||||
exp(i);
|
exp(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -708,8 +659,7 @@ returnvalue=true
|
||||||
|
|
||||||
#include "B.h"
|
#include "B.h"
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -727,8 +677,7 @@ private:
|
||||||
|
|
||||||
#include "B.h"
|
#include "B.h"
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -736,7 +685,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int help();
|
int help();
|
||||||
int exp(int i, B *& b, int & y, float & x);
|
int exp(int i, B*& b, int& y, float& x);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /*A_H_*/
|
#endif /*A_H_*/
|
||||||
|
@ -744,12 +693,10 @@ private:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
int i = 2;
|
int i = 2;
|
||||||
float x = i;
|
float x = i;
|
||||||
B* b = new B();
|
B* b = new B();
|
||||||
|
@ -761,8 +708,9 @@ A::~A()
|
||||||
b->hello(y);
|
b->hello(y);
|
||||||
++x;
|
++x;
|
||||||
i++;
|
i++;
|
||||||
}int A::foo()
|
}
|
||||||
{
|
|
||||||
|
int A::foo() {
|
||||||
int i = 2;
|
int i = 2;
|
||||||
float x = i;
|
float x = i;
|
||||||
B* b = new B();
|
B* b = new B();
|
||||||
|
@ -776,20 +724,17 @@ A::~A()
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
int i = 2;
|
int i = 2;
|
||||||
float x = i;
|
float x = i;
|
||||||
B* b = new B();
|
B* b = new B();
|
||||||
|
@ -798,8 +743,9 @@ A::~A()
|
||||||
b->hello(y);
|
b->hello(y);
|
||||||
++x;
|
++x;
|
||||||
i++;
|
i++;
|
||||||
}int A::exp(int i, B *& b, int & y, float & x)
|
}
|
||||||
{
|
|
||||||
|
int A::exp(int i, B*& b, int& y, float& x) {
|
||||||
++i;
|
++i;
|
||||||
b->hello(y);
|
b->hello(y);
|
||||||
i = i + x;
|
i = i + x;
|
||||||
|
@ -807,8 +753,7 @@ A::~A()
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
int i = 2;
|
int i = 2;
|
||||||
float x = i;
|
float x = i;
|
||||||
B* b = new B();
|
B* b = new B();
|
||||||
|
@ -819,8 +764,7 @@ int A::foo()
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -849,8 +793,7 @@ returnvalue=true
|
||||||
|
|
||||||
#include "B.h"
|
#include "B.h"
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -868,8 +811,7 @@ private:
|
||||||
|
|
||||||
#include "B.h"
|
#include "B.h"
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -877,7 +819,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int help();
|
int help();
|
||||||
int exp(int i, B *& b, int & y, float x);
|
int exp(int i, B*& b, int& y, float x);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /*A_H_*/
|
#endif /*A_H_*/
|
||||||
|
@ -885,12 +827,10 @@ private:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
int i = 2;
|
int i = 2;
|
||||||
float x = i;
|
float x = i;
|
||||||
B* b = new B();
|
B* b = new B();
|
||||||
|
@ -902,8 +842,9 @@ A::~A()
|
||||||
b->hello(y);
|
b->hello(y);
|
||||||
++x;
|
++x;
|
||||||
i++;
|
i++;
|
||||||
}int A::foo()
|
}
|
||||||
{
|
|
||||||
|
int A::foo() {
|
||||||
int i = 2;
|
int i = 2;
|
||||||
float x = i;
|
float x = i;
|
||||||
B* b = new B();
|
B* b = new B();
|
||||||
|
@ -916,20 +857,17 @@ A::~A()
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
int i = 2;
|
int i = 2;
|
||||||
float x = i;
|
float x = i;
|
||||||
B* b = new B();
|
B* b = new B();
|
||||||
|
@ -941,8 +879,9 @@ A::~A()
|
||||||
b->hello(y);
|
b->hello(y);
|
||||||
++x;
|
++x;
|
||||||
i++;
|
i++;
|
||||||
}int A::exp(int i, B *& b, int & y, float x)
|
}
|
||||||
{
|
|
||||||
|
int A::exp(int i, B*& b, int& y, float x) {
|
||||||
++i;
|
++i;
|
||||||
b->hello(y);
|
b->hello(y);
|
||||||
i = i + x;
|
i = i + x;
|
||||||
|
@ -950,8 +889,7 @@ A::~A()
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
int i = 2;
|
int i = 2;
|
||||||
float x = i;
|
float x = i;
|
||||||
B* b = new B();
|
B* b = new B();
|
||||||
|
@ -961,8 +899,7 @@ int A::foo()
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -988,8 +925,7 @@ replaceduplicates=true
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -1005,8 +941,7 @@ private:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -1014,7 +949,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int help();
|
int help();
|
||||||
void exp(int & i);
|
void exp(int& i);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /*A_H_*/
|
#endif /*A_H_*/
|
||||||
|
@ -1022,54 +957,49 @@ private:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
int i = 2;
|
int i = 2;
|
||||||
++i;
|
++i;
|
||||||
help();
|
help();
|
||||||
}int A::foo()
|
}
|
||||||
{
|
|
||||||
|
int A::foo() {
|
||||||
int i = 2;
|
int i = 2;
|
||||||
/*$*/++i;
|
/*$*/++i;
|
||||||
help();/*$$*/
|
help();/*$$*/
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
int i = 2;
|
int i = 2;
|
||||||
exp(i);
|
exp(i);
|
||||||
}void A::exp(int & i)
|
}
|
||||||
{
|
|
||||||
|
void A::exp(int& i) {
|
||||||
++i;
|
++i;
|
||||||
help();
|
help();
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
int i = 2;
|
int i = 2;
|
||||||
exp(i);
|
exp(i);
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,7 @@
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -21,8 +20,7 @@ private:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -38,52 +36,45 @@ private:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
int A::foo()
|
|
||||||
{
|
int A::foo() {
|
||||||
int i = 2;
|
int i = 2;
|
||||||
++i;
|
++i;
|
||||||
help();
|
help();
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
int A::exp()
|
|
||||||
{
|
int A::exp() {
|
||||||
int i = 2;
|
int i = 2;
|
||||||
++i;
|
++i;
|
||||||
help();
|
help();
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
int i = exp();
|
int i = exp();
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,7 +84,7 @@ int A::help()
|
||||||
<refactoring comment="Create method exp" description="Extract Method Refactoring"
|
<refactoring comment="Create method exp" description="Extract Method Refactoring"
|
||||||
fileName="file:$$projectPath$$/A.cpp"
|
fileName="file:$$projectPath$$/A.cpp"
|
||||||
flags="4" id="org.eclipse.cdt.internal.ui.refactoring.extractfunction.ExtractFunctionRefactoring"
|
flags="4" id="org.eclipse.cdt.internal.ui.refactoring.extractfunction.ExtractFunctionRefactoring"
|
||||||
name="exp" project="RegressionTestProject" selection="56,25" visibility="private"/>
|
name="exp" project="RegressionTestProject" selection="57,25" visibility="private"/>
|
||||||
</session>
|
</session>
|
||||||
|
|
||||||
|
|
||||||
|
@ -103,8 +94,7 @@ int A::help()
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -120,8 +110,7 @@ private:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -129,7 +118,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int help();
|
int help();
|
||||||
void exp(int & i);
|
void exp(int& i);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /*A_H_*/
|
#endif /*A_H_*/
|
||||||
|
@ -137,15 +126,13 @@ private:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
int A::foo()
|
|
||||||
{
|
int A::foo() {
|
||||||
int i = 2;
|
int i = 2;
|
||||||
//comment
|
//comment
|
||||||
++i;
|
++i;
|
||||||
|
@ -153,38 +140,33 @@ int A::foo()
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
void A::exp(int & i)
|
|
||||||
{
|
void A::exp(int& i) {
|
||||||
//comment
|
//comment
|
||||||
++i;
|
++i;
|
||||||
help();
|
help();
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
int i = 2;
|
int i = 2;
|
||||||
//comment
|
//comment
|
||||||
exp(i);
|
exp(i);
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,29 +176,26 @@ int A::help()
|
||||||
<refactoring comment="Create method exp" description="Extract Method Refactoring"
|
<refactoring comment="Create method exp" description="Extract Method Refactoring"
|
||||||
fileName="file:$$projectPath$$/A.cpp"
|
fileName="file:$$projectPath$$/A.cpp"
|
||||||
flags="4" id="org.eclipse.cdt.internal.ui.refactoring.extractfunction.ExtractFunctionRefactoring"
|
flags="4" id="org.eclipse.cdt.internal.ui.refactoring.extractfunction.ExtractFunctionRefactoring"
|
||||||
name="exp" project="RegressionTestProject" selection="79,13" visibility="private"/>
|
name="exp" project="RegressionTestProject" selection="69,24" visibility="private"/>
|
||||||
</session>
|
</session>
|
||||||
|
|
||||||
//!Extract Function History first extracted statement with leading comment
|
//!Extract Function History first extracted statement with leading comment
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.RefactoringHistoryTest
|
//#org.eclipse.cdt.ui.tests.refactoring.RefactoringHistoryTest
|
||||||
//@main.cpp
|
//@main.cpp
|
||||||
int main(){
|
int main() {
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
// Comment
|
// Comment
|
||||||
i= 7;
|
i = 7;
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
void exp(int & i)
|
void exp(int& i) {
|
||||||
{
|
|
||||||
// Comment
|
// Comment
|
||||||
i = 7;
|
i = 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(){
|
int main() {
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
// Comment
|
// Comment
|
||||||
exp(i);
|
exp(i);
|
||||||
|
@ -229,27 +208,24 @@ int main(){
|
||||||
<refactoring comment="Create method exp" description="Extract Method Refactoring"
|
<refactoring comment="Create method exp" description="Extract Method Refactoring"
|
||||||
fileName="file:$$projectPath$$/main.cpp"
|
fileName="file:$$projectPath$$/main.cpp"
|
||||||
flags="4" id="org.eclipse.cdt.internal.ui.refactoring.extractfunction.ExtractFunctionRefactoring"
|
flags="4" id="org.eclipse.cdt.internal.ui.refactoring.extractfunction.ExtractFunctionRefactoring"
|
||||||
name="exp" project="RegressionTestProject" selection="35,5" visibility="private"/>
|
name="exp" project="RegressionTestProject" selection="34,6" visibility="private"/>
|
||||||
</session>
|
</session>
|
||||||
|
|
||||||
//!Extract Function History extracted statement with trailling comment
|
//!Extract Function History extracted statement with trailling comment
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.RefactoringHistoryTest
|
//#org.eclipse.cdt.ui.tests.refactoring.RefactoringHistoryTest
|
||||||
//@main.cpp
|
//@main.cpp
|
||||||
int main(){
|
int main() {
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
i= 7; // Comment
|
i = 7; // Comment
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
void exp(int & i)
|
void exp(int& i) {
|
||||||
{
|
|
||||||
i = 7; // Comment
|
i = 7; // Comment
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(){
|
int main() {
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
exp(i); // Comment
|
exp(i); // Comment
|
||||||
return i;
|
return i;
|
||||||
|
@ -261,7 +237,7 @@ int main(){
|
||||||
<refactoring comment="Create method exp" description="Extract Method Refactoring"
|
<refactoring comment="Create method exp" description="Extract Method Refactoring"
|
||||||
fileName="file:$$projectPath$$/main.cpp"
|
fileName="file:$$projectPath$$/main.cpp"
|
||||||
flags="4" id="org.eclipse.cdt.internal.ui.refactoring.extractfunction.ExtractFunctionRefactoring"
|
flags="4" id="org.eclipse.cdt.internal.ui.refactoring.extractfunction.ExtractFunctionRefactoring"
|
||||||
name="exp" project="RegressionTestProject" selection="23,5" visibility="private"/>
|
name="exp" project="RegressionTestProject" selection="22,6" visibility="private"/>
|
||||||
</session>
|
</session>
|
||||||
|
|
||||||
//!ExtractFunctionRefactoringTest duplicates with different Names History Test
|
//!ExtractFunctionRefactoringTest duplicates with different Names History Test
|
||||||
|
@ -270,8 +246,7 @@ int main(){
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -287,8 +262,7 @@ private:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -296,7 +270,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int help();
|
int help();
|
||||||
void exp(int & i);
|
void exp(int& i);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /*A_H_*/
|
#endif /*A_H_*/
|
||||||
|
@ -304,54 +278,49 @@ private:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
int oo = 99;
|
int oo = 99;
|
||||||
++oo;
|
++oo;
|
||||||
help();
|
help();
|
||||||
}int A::foo()
|
}
|
||||||
{
|
|
||||||
|
int A::foo() {
|
||||||
int i = 2;
|
int i = 2;
|
||||||
++i;
|
++i;
|
||||||
help();
|
help();
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
int oo = 99;
|
int oo = 99;
|
||||||
exp(oo);
|
exp(oo);
|
||||||
}void A::exp(int & i)
|
}
|
||||||
{
|
|
||||||
|
void A::exp(int& i) {
|
||||||
++i;
|
++i;
|
||||||
help();
|
help();
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
int i = 2;
|
int i = 2;
|
||||||
exp(i);
|
exp(i);
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -360,5 +329,5 @@ int A::help()
|
||||||
<session version="1.0">
|
<session version="1.0">
|
||||||
<refactoring comment="Create method exp" description="Extract Method Refactoring"
|
<refactoring comment="Create method exp" description="Extract Method Refactoring"
|
||||||
fileName="file:$$projectPath$$/A.cpp" flags="4" id="org.eclipse.cdt.internal.ui.refactoring.extractfunction.ExtractFunctionRefactoring"
|
fileName="file:$$projectPath$$/A.cpp" flags="4" id="org.eclipse.cdt.internal.ui.refactoring.extractfunction.ExtractFunctionRefactoring"
|
||||||
name="exp" project="RegressionTestProject" replaceDuplicates="true" selection="97,13" visibility="private"/>
|
name="exp" project="RegressionTestProject" replaceDuplicates="true" selection="99,13" visibility="private"/>
|
||||||
</session>
|
</session>
|
||||||
|
|
|
@ -4,8 +4,7 @@
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -21,8 +20,7 @@ private:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
|
@ -30,7 +28,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int help();
|
int help();
|
||||||
void exp(int & ii);
|
void exp(int& ii);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /*A_H_*/
|
#endif /*A_H_*/
|
||||||
|
@ -40,15 +38,13 @@ private:
|
||||||
|
|
||||||
#define ADD(a,ab) a + ab + 2 + a
|
#define ADD(a,ab) a + ab + 2 + a
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
int A::foo()
|
|
||||||
{
|
int A::foo() {
|
||||||
int ii = 2;
|
int ii = 2;
|
||||||
/*$*/++ii;
|
/*$*/++ii;
|
||||||
ii = ADD(ii, 42);
|
ii = ADD(ii, 42);
|
||||||
|
@ -56,8 +52,7 @@ int A::foo()
|
||||||
return ii;
|
return ii;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,29 +61,25 @@ int A::help()
|
||||||
|
|
||||||
#define ADD(a,ab) a + ab + 2 + a
|
#define ADD(a,ab) a + ab + 2 + a
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
void A::exp(int & ii)
|
|
||||||
{
|
void A::exp(int& ii) {
|
||||||
++ii;
|
++ii;
|
||||||
ii = ADD(ii, 42);
|
ii = ADD(ii, 42);
|
||||||
help();
|
help();
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
int ii = 2;
|
int ii = 2;
|
||||||
exp(ii);
|
exp(ii);
|
||||||
return ii;
|
return ii;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,12 +92,12 @@ returnparameterindex=1
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
int foo();
|
int foo();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int help();
|
int help();
|
||||||
};
|
};
|
||||||
|
@ -117,15 +108,15 @@ private:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
int foo();
|
int foo();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int help();
|
int help();
|
||||||
int exp(int & i, int b);
|
int exp(int& i, int b);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /*A_H_*/
|
#endif /*A_H_*/
|
||||||
|
@ -135,15 +126,13 @@ private:
|
||||||
|
|
||||||
#define ADD(b) b = b + 2
|
#define ADD(b) b = b + 2
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
int A::foo()
|
|
||||||
{
|
int A::foo() {
|
||||||
int i = 2;
|
int i = 2;
|
||||||
int b = 42;
|
int b = 42;
|
||||||
/*$*/++i;
|
/*$*/++i;
|
||||||
|
@ -153,8 +142,7 @@ int A::foo()
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,23 +151,20 @@ int A::help()
|
||||||
|
|
||||||
#define ADD(b) b = b + 2
|
#define ADD(b) b = b + 2
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
int A::exp(int & i, int b)
|
|
||||||
{
|
int A::exp(int& i, int b) {
|
||||||
++i;
|
++i;
|
||||||
help();
|
help();
|
||||||
ADD(b);
|
ADD(b);
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
int i = 2;
|
int i = 2;
|
||||||
int b = 42;
|
int b = 42;
|
||||||
b = exp(i, b);
|
b = exp(i, b);
|
||||||
|
@ -187,8 +172,7 @@ int A::foo()
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,12 +186,12 @@ replaceduplicates=true
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
int foo();
|
int foo();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int help();
|
int help();
|
||||||
};
|
};
|
||||||
|
@ -218,12 +202,12 @@ private:
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
virtual ~A();
|
virtual ~A();
|
||||||
int foo();
|
int foo();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int help();
|
int help();
|
||||||
int exp(int bb);
|
int exp(int bb);
|
||||||
|
@ -236,15 +220,13 @@ private:
|
||||||
|
|
||||||
#define ADD(b) b = b + 2
|
#define ADD(b) b = b + 2
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
int A::foo()
|
|
||||||
{
|
int A::foo() {
|
||||||
int i = 2;
|
int i = 2;
|
||||||
int bb = 42;
|
int bb = 42;
|
||||||
++i;
|
++i;
|
||||||
|
@ -254,8 +236,7 @@ int A::foo()
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -264,22 +245,19 @@ int A::help()
|
||||||
|
|
||||||
#define ADD(b) b = b + 2
|
#define ADD(b) b = b + 2
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
int A::exp(int bb)
|
|
||||||
{
|
int A::exp(int bb) {
|
||||||
ADD(bb);
|
ADD(bb);
|
||||||
ADD(bb);
|
ADD(bb);
|
||||||
return bb;
|
return bb;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
int i = 2;
|
int i = 2;
|
||||||
int bb = 42;
|
int bb = 42;
|
||||||
++i;
|
++i;
|
||||||
|
@ -288,8 +266,7 @@ int A::foo()
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::help()
|
int A::help() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -8,11 +8,12 @@ filename=A.h
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
/*$*/void method2();/*$$*/
|
/*$*/void method2();/*$$*/
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
};
|
};
|
||||||
|
@ -25,10 +26,11 @@ private:
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
void method2();
|
void method2();
|
||||||
|
@ -46,12 +48,13 @@ filename=A.h
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
//Kommentar
|
//Comment
|
||||||
/*$*/void method2();/*$$*/
|
/*$*/void method2();/*$$*/
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
};
|
};
|
||||||
|
@ -64,13 +67,14 @@ private:
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
//Kommentar
|
//Comment
|
||||||
void method2();
|
void method2();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -86,10 +90,10 @@ filename=A.h
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
/*Kommentar*/
|
/*Comment*/
|
||||||
/*$*/void method2();/*$$*/
|
/*$*/void method2();/*$$*/
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
|
@ -105,13 +109,14 @@ private:
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
/*Kommentar*/
|
/*Comment*/
|
||||||
void method2();
|
void method2();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -127,11 +132,12 @@ filename=A.h
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
/*$*/void method2();/*$$*///Kommentar
|
/*$*/void method2();/*$$*///Comment
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
};
|
};
|
||||||
|
@ -144,13 +150,14 @@ private:
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
void method2(); //Kommentar
|
void method2(); //Comment
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /*A_H_*/
|
#endif /*A_H_*/
|
||||||
|
@ -165,11 +172,12 @@ filename=A.h
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
/*$*/void method2();/*$$*//*Kommentar*/
|
/*$*/void method2();/*$$*//*Comment*/
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
};
|
};
|
||||||
|
@ -182,13 +190,14 @@ private:
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
void method2(); /*Kommentar*/
|
void method2(); /*Comment*/
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /*A_H_*/
|
#endif /*A_H_*/
|
||||||
|
@ -203,13 +212,14 @@ filename=A.h
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
|
|
||||||
//Kommentar
|
//Comment
|
||||||
/*$*/void method2();/*$$*/
|
/*$*/void method2();/*$$*/
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
};
|
};
|
||||||
|
@ -222,13 +232,14 @@ private:
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
//Kommentar
|
//Comment
|
||||||
void method2();
|
void method2();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -244,13 +255,14 @@ filename=A.h
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
|
|
||||||
/*Kommentar*/
|
/*Comment*/
|
||||||
/*$*/void method2();/*$$*/
|
/*$*/void method2();/*$$*/
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
};
|
};
|
||||||
|
@ -263,13 +275,14 @@ private:
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
/*Kommentar*/
|
/*Comment*/
|
||||||
void method2();
|
void method2();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -285,11 +298,12 @@ filename=A.h
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
/*$*/void method2();/*$$*///Kommentar
|
/*$*/void method2();/*$$*///Comment
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
};
|
};
|
||||||
|
@ -302,13 +316,14 @@ private:
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
void method2(); //Kommentar
|
void method2(); //Comment
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /*A_H_*/
|
#endif /*A_H_*/
|
||||||
|
@ -323,12 +338,13 @@ filename=A.h
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
/*$*/void method2();/*$$*//*Kommentar*/
|
/*$*/void method2();/*$$*//*Comment*/
|
||||||
|
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
};
|
};
|
||||||
|
@ -340,13 +356,14 @@ private:
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
void method2(); /*Kommentar*/
|
void method2(); /*Comment*/
|
||||||
};
|
};
|
||||||
#endif /*A_H_*/
|
#endif /*A_H_*/
|
||||||
|
|
||||||
|
@ -360,14 +377,15 @@ filename=A.h
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
/*
|
/*
|
||||||
* Kommentar
|
* Comment
|
||||||
*/
|
*/
|
||||||
/*$*/void method2();/*$$*/
|
/*$*/void method2();/*$$*/
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
};
|
};
|
||||||
|
@ -379,14 +397,15 @@ private:
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
/*
|
/*
|
||||||
* Kommentar
|
* Comment
|
||||||
*/
|
*/
|
||||||
void method2();
|
void method2();
|
||||||
};
|
};
|
||||||
|
@ -402,13 +421,14 @@ filename=A.h
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
/*$*/void method2();/*$$*/ /*
|
/*$*/void method2();/*$$*/ /*
|
||||||
* Kommentar
|
* Comment
|
||||||
*/
|
*/
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
};
|
};
|
||||||
|
@ -421,14 +441,15 @@ private:
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
void method2(); /*
|
void method2(); /*
|
||||||
* Kommentar
|
* Comment
|
||||||
*/
|
*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -444,16 +465,17 @@ filename=A.h
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
/*
|
/*
|
||||||
* Davor
|
* Davor
|
||||||
*/
|
*/
|
||||||
/*$*/void method2();/*$$*/ /*
|
/*$*/void method2();/*$$*/ /*
|
||||||
* Kommentar
|
* Comment
|
||||||
*/
|
*/
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
};
|
};
|
||||||
|
@ -466,17 +488,18 @@ private:
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
/*
|
/*
|
||||||
* Davor
|
* Davor
|
||||||
*/
|
*/
|
||||||
void method2(); /*
|
void method2(); /*
|
||||||
* Kommentar
|
* Comment
|
||||||
*/
|
*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -492,12 +515,13 @@ filename=A.h
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
/*123*/
|
/*123*/
|
||||||
/*$*/void method2();/*$$*///TEST
|
/*$*/void method2();/*$$*///TEST
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
};
|
};
|
||||||
|
@ -510,10 +534,11 @@ private:
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
/*123*/
|
/*123*/
|
||||||
|
@ -532,12 +557,13 @@ filename=A.h
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
/*123*/
|
/*123*/
|
||||||
/*$*/void method2();/*$$*//*TEST*/
|
/*$*/void method2();/*$$*//*TEST*/
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
};
|
};
|
||||||
|
@ -549,10 +575,11 @@ private:
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
/*123*/
|
/*123*/
|
||||||
|
@ -571,7 +598,7 @@ errors=1
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
private:
|
private:
|
||||||
/*$*/void method2();/*$$*/
|
/*$*/void method2();/*$$*/
|
||||||
};
|
};
|
||||||
|
@ -584,7 +611,7 @@ private:
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
private:
|
private:
|
||||||
void method2();
|
void method2();
|
||||||
};
|
};
|
||||||
|
@ -601,7 +628,7 @@ filename=A.h
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
/*$*/void method1();/*$$*/
|
/*$*/void method1();/*$$*/
|
||||||
void method2();
|
void method2();
|
||||||
|
@ -615,9 +642,10 @@ public:
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
void method2();
|
void method2();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void method1();
|
void method1();
|
||||||
};
|
};
|
||||||
|
@ -634,7 +662,7 @@ filename=A.h
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
/*$*/void method1();/*$$*/void method2();
|
/*$*/void method1();/*$$*/void method2();
|
||||||
};
|
};
|
||||||
|
@ -647,9 +675,10 @@ public:
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
void method2();
|
void method2();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void method1();
|
void method1();
|
||||||
};
|
};
|
||||||
|
@ -666,9 +695,9 @@ filename=A.h
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
//Kommentar
|
//Comment
|
||||||
/*$*/void method1();/*$$*/
|
/*$*/void method1();/*$$*/
|
||||||
void method2();
|
void method2();
|
||||||
};
|
};
|
||||||
|
@ -681,11 +710,12 @@ public:
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
void method2();
|
void method2();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//Kommentar
|
//Comment
|
||||||
void method1();
|
void method1();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -701,9 +731,9 @@ filename=A.h
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
//Kommentar
|
//Comment
|
||||||
/*$*/void method1();/*$$*/void method2();
|
/*$*/void method1();/*$$*/void method2();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -715,11 +745,12 @@ public:
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
void method2();
|
void method2();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//Kommentar
|
//Comment
|
||||||
void method1();
|
void method1();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -733,11 +764,12 @@ private:
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
void method2();
|
void method2();
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
};
|
};
|
||||||
|
@ -750,10 +782,11 @@ private:
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
void method2();
|
void method2();
|
||||||
|
@ -776,12 +809,13 @@ void A::/*$*/method2/*$$*/()
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
//TEST 1
|
//TEST 1
|
||||||
void method2(); //TEST 2
|
void method2(); //TEST 2
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
};
|
};
|
||||||
|
@ -794,10 +828,11 @@ private:
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
//TEST 1
|
//TEST 1
|
||||||
|
@ -826,11 +861,9 @@ public:
|
||||||
HideMethod();
|
HideMethod();
|
||||||
virtual ~HideMethod();
|
virtual ~HideMethod();
|
||||||
void /*$*/methode2/*$$*/();
|
void /*$*/methode2/*$$*/();
|
||||||
void methode3()
|
void methode3() {
|
||||||
{
|
|
||||||
methode2();
|
methode2();
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* HIDEMETHOD_H_ */
|
#endif /* HIDEMETHOD_H_ */
|
||||||
|
@ -843,14 +876,12 @@ class HideMethod {
|
||||||
public:
|
public:
|
||||||
HideMethod();
|
HideMethod();
|
||||||
virtual ~HideMethod();
|
virtual ~HideMethod();
|
||||||
void methode3()
|
void methode3() {
|
||||||
{
|
|
||||||
methode2();
|
methode2();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void methode2();
|
void methode2();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* HIDEMETHOD_H_ */
|
#endif /* HIDEMETHOD_H_ */
|
||||||
|
@ -882,6 +913,7 @@ public:
|
||||||
HideMethod();
|
HideMethod();
|
||||||
virtual ~HideMethod();
|
virtual ~HideMethod();
|
||||||
void methode3();
|
void methode3();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void methode2();
|
void methode2();
|
||||||
};
|
};
|
||||||
|
@ -947,7 +979,7 @@ public:
|
||||||
|
|
||||||
class test{
|
class test{
|
||||||
public:
|
public:
|
||||||
void call(){
|
void call() {
|
||||||
HideMethod hm;
|
HideMethod hm;
|
||||||
hm.methode2();
|
hm.methode2();
|
||||||
}
|
}
|
||||||
|
@ -964,13 +996,14 @@ public:
|
||||||
HideMethod();
|
HideMethod();
|
||||||
virtual ~HideMethod();
|
virtual ~HideMethod();
|
||||||
void methode3();
|
void methode3();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void methode2();
|
void methode2();
|
||||||
};
|
};
|
||||||
|
|
||||||
class test{
|
class test{
|
||||||
public:
|
public:
|
||||||
void call(){
|
void call() {
|
||||||
HideMethod hm;
|
HideMethod hm;
|
||||||
hm.methode2();
|
hm.methode2();
|
||||||
}
|
}
|
||||||
|
@ -1006,6 +1039,7 @@ public:
|
||||||
HideMethod();
|
HideMethod();
|
||||||
virtual ~HideMethod();
|
virtual ~HideMethod();
|
||||||
void methode3();
|
void methode3();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void methode2();
|
void methode2();
|
||||||
};
|
};
|
||||||
|
@ -1032,7 +1066,7 @@ void HideMethod::methode3() {
|
||||||
//do nothing
|
//do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(){
|
int main() {
|
||||||
HideMethod hm;
|
HideMethod hm;
|
||||||
hm.methode2();
|
hm.methode2();
|
||||||
}
|
}
|
||||||
|
@ -1058,7 +1092,7 @@ void HideMethod::methode3() {
|
||||||
//do nothing
|
//do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(){
|
int main() {
|
||||||
HideMethod hm;
|
HideMethod hm;
|
||||||
hm.methode2();
|
hm.methode2();
|
||||||
}
|
}
|
||||||
|
@ -1090,6 +1124,7 @@ public:
|
||||||
HideMethod();
|
HideMethod();
|
||||||
virtual ~HideMethod();
|
virtual ~HideMethod();
|
||||||
void methode3();
|
void methode3();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void methode2();
|
void methode2();
|
||||||
};
|
};
|
||||||
|
@ -1146,7 +1181,7 @@ filename=A.h
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
/*$*/void method2();/*$$*/
|
/*$*/void method2();/*$$*/
|
||||||
};
|
};
|
||||||
|
@ -1159,7 +1194,7 @@ public:
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
private:
|
private:
|
||||||
void method2();
|
void method2();
|
||||||
|
@ -1178,7 +1213,7 @@ errors=1
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
/*$*/void method2();/*$$*/
|
/*$*/void method2();/*$$*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1190,7 +1225,7 @@ class A{
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
void method2();
|
void method2();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1206,7 +1241,7 @@ filename=A.h
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
struct A{
|
struct A {
|
||||||
/*$*/void method2();/*$$*/
|
/*$*/void method2();/*$$*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1218,7 +1253,7 @@ struct A{
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
struct A{
|
struct A {
|
||||||
private:
|
private:
|
||||||
void method2();
|
void method2();
|
||||||
};
|
};
|
||||||
|
@ -1230,40 +1265,33 @@ private:
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.cpp
|
filename=A.cpp
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
struct other
|
struct other {
|
||||||
{
|
bool value() { return true; }
|
||||||
bool value() {return true;}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class Klass
|
class Class {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
void /*$*/set/*$$*/(bool b){}
|
void /*$*/set/*$$*/(bool b) {}
|
||||||
void test()
|
void test() {
|
||||||
{
|
|
||||||
other o;
|
other o;
|
||||||
this->set(o.value());
|
this->set(o.value());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//=
|
//=
|
||||||
struct other
|
struct other {
|
||||||
{
|
bool value() { return true; }
|
||||||
bool value() {return true;}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class Klass
|
class Class {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
void test()
|
void test() {
|
||||||
{
|
|
||||||
other o;
|
other o;
|
||||||
this->set(o.value());
|
this->set(o.value());
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void set(bool b)
|
void set(bool b) {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1272,40 +1300,35 @@ private:
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.cpp
|
filename=A.cpp
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
struct other
|
struct other {
|
||||||
{
|
bool value() { return true; }
|
||||||
bool value() {return true;}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class Klass
|
class Class {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
void set(bool b){}
|
void set(bool b) {
|
||||||
void test()
|
}
|
||||||
{
|
|
||||||
|
void test() {
|
||||||
other o;
|
other o;
|
||||||
this->/*$*/set/*$$*/(o.value());
|
this->/*$*/set/*$$*/(o.value());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//=
|
//=
|
||||||
struct other
|
struct other {
|
||||||
{
|
bool value() { return true; }
|
||||||
bool value() {return true;}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class Klass
|
class Class {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
void test()
|
void test() {
|
||||||
{
|
|
||||||
other o;
|
other o;
|
||||||
this->set(o.value());
|
this->set(o.value());
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void set(bool b)
|
void set(bool b) {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1315,35 +1338,29 @@ private:
|
||||||
filename=A.cpp
|
filename=A.cpp
|
||||||
warnings=1
|
warnings=1
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
struct other
|
struct other {
|
||||||
{
|
bool /*$*/value/*$$*/() { return true; }
|
||||||
bool /*$*/value/*$$*/() {return true;}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class Klass
|
class Class {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
void set(bool b){}
|
void set(bool b) {}
|
||||||
void test()
|
void test() {
|
||||||
{
|
|
||||||
other o;
|
other o;
|
||||||
this->set(o.value());
|
this->set(o.value());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//=
|
//=
|
||||||
struct other
|
struct other {
|
||||||
{
|
|
||||||
private:
|
private:
|
||||||
bool value() {return true;}
|
bool value() { return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class Klass
|
class Class {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
void set(bool b){}
|
void set(bool b) {}
|
||||||
void test()
|
void test() {
|
||||||
{
|
|
||||||
other o;
|
other o;
|
||||||
this->set(o.value());
|
this->set(o.value());
|
||||||
}
|
}
|
||||||
|
@ -1354,36 +1371,34 @@ public:
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.cpp
|
filename=A.cpp
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
struct other
|
struct other {
|
||||||
{
|
bool value() { return true; }
|
||||||
bool value() {return true;}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class Klass
|
class Class {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
void set(bool b){}
|
void set(bool b) {
|
||||||
void /*$*/test/*$$*/()
|
}
|
||||||
{
|
|
||||||
|
void /*$*/test/*$$*/() {
|
||||||
other o;
|
other o;
|
||||||
this->set(o.value());
|
this->set(o.value());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//=
|
//=
|
||||||
struct other
|
struct other {
|
||||||
{
|
bool value() { return true; }
|
||||||
bool value() {return true;}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class Klass
|
class Class {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
void set(bool b){}
|
void set(bool b) {
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void test()
|
|
||||||
{
|
void test() {
|
||||||
other o;
|
other o;
|
||||||
this->set(o.value());
|
this->set(o.value());
|
||||||
}
|
}
|
||||||
|
@ -1395,14 +1410,14 @@ private:
|
||||||
filename=A.cpp
|
filename=A.cpp
|
||||||
fatalerrors=1
|
fatalerrors=1
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
int /*$*/main/*$$*/(){
|
int /*$*/main/*$$*/() {
|
||||||
int i = 2;
|
int i = 2;
|
||||||
i++;
|
i++;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
int main(){
|
int main() {
|
||||||
int i = 2;
|
int i = 2;
|
||||||
i++;
|
i++;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1413,8 +1428,7 @@ int main(){
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
class Klass
|
class Class {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
void /*$*/to_move()/*$$*/;
|
void /*$*/to_move()/*$$*/;
|
||||||
|
|
||||||
|
@ -1423,8 +1437,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
//=
|
//=
|
||||||
class Klass
|
class Class {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
private:
|
private:
|
||||||
void just_private();
|
void just_private();
|
||||||
|
@ -1436,23 +1449,23 @@ private:
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
class Klass
|
class Class {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
void /*$*/to_move()/*$$*/;
|
void /*$*/to_move()/*$$*/;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void just_private();
|
void just_private();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
|
||||||
//=
|
//=
|
||||||
class Klass
|
class Class {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
private:
|
private:
|
||||||
void just_private();
|
void just_private();
|
||||||
void to_move();
|
void to_move();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -6,11 +6,12 @@
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
void method2();
|
void method2();
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
};
|
};
|
||||||
|
@ -23,10 +24,11 @@ private:
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
void method2();
|
void method2();
|
||||||
|
@ -40,5 +42,5 @@ private:
|
||||||
<refactoring comment="Hide Method method2" description="Hide Method Refactoring"
|
<refactoring comment="Hide Method method2" description="Hide Method Refactoring"
|
||||||
fileName="file:$$projectPath$$/A.h" flags="2"
|
fileName="file:$$projectPath$$/A.h" flags="2"
|
||||||
id="org.eclipse.cdt.internal.ui.refactoring.hidemethod.HideMethodRefactoring"
|
id="org.eclipse.cdt.internal.ui.refactoring.hidemethod.HideMethodRefactoring"
|
||||||
project="RegressionTestProject" selection="83,7"/>
|
project="RegressionTestProject" selection="78,7"/>
|
||||||
</session>
|
</session>
|
||||||
|
|
|
@ -15,12 +15,10 @@ public:
|
||||||
bool a(int = 100) const;
|
bool a(int = 100) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline bool X::a(int int1) const
|
inline bool X::a(int int1) const {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//!Param const and reference and pointer two params
|
//!Param const and reference and pointer two params
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -38,37 +36,34 @@ public:
|
||||||
bool xy(int, int i) const;
|
bool xy(int, int i) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline bool X::xy(int int1, int i) const
|
inline bool X::xy(int int1, int i) const {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//!Test if TemplateMethod stays in header
|
//!Test if TemplateMethod stays in header
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
infos=1
|
infos=1
|
||||||
//@A.h
|
//@A.h
|
||||||
template<class T> class A
|
template<class T>
|
||||||
{
|
class A {
|
||||||
public:
|
public:
|
||||||
/*$*/void test();/*$$*/
|
/*$*/void test();/*$$*/
|
||||||
};
|
};
|
||||||
|
|
||||||
//=
|
//=
|
||||||
template<class T> class A
|
template<class T>
|
||||||
{
|
class A {
|
||||||
public:
|
public:
|
||||||
void test();
|
void test();
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class T> inline void A<T>::test()
|
template<class T>
|
||||||
{
|
inline void A<T>::test() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
|
@ -81,45 +76,42 @@ template<class T> inline void A<T>::test()
|
||||||
filename=A.h
|
filename=A.h
|
||||||
infos=1
|
infos=1
|
||||||
//@A.h
|
//@A.h
|
||||||
template<class T> class A
|
template<class T>
|
||||||
{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
/*$*/void test();/*$$*/
|
/*$*/void test();/*$$*/
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class T> A<T>::A()
|
template<class T>
|
||||||
{
|
A<T>::A() {
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
template<class T> class A
|
template<class T>
|
||||||
{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
void test();
|
void test();
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class T> A<T>::A()
|
template<class T>
|
||||||
{
|
A<T>::A() {
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T> inline void A<T>::test()
|
template<class T>
|
||||||
{
|
inline void A<T>::test() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//!member class
|
//!member class
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
|
|
||||||
class Demo
|
class Demo {
|
||||||
{
|
class SubClass {
|
||||||
class SubClass
|
|
||||||
{
|
|
||||||
/*$*/void test();/*$$*/
|
/*$*/void test();/*$$*/
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -131,51 +123,41 @@ class Demo
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
|
void Demo::SubClass::test() {
|
||||||
|
|
||||||
void Demo::SubClass::test()
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
//!Method declared in otherwise empty class without cpp file
|
||||||
//!method declared in otherwise empty class without cpp file
|
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
infos=1
|
infos=1
|
||||||
//@A.h
|
//@A.h
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
/*$*/void test();/*$$*/
|
/*$*/void test();/*$$*/
|
||||||
};
|
};
|
||||||
|
|
||||||
//=
|
//=
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
void test();
|
void test();
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void A::test()
|
inline void A::test() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//!Method declared in otherwise empty class
|
||||||
//!method declared in otherwise empty class
|
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
/*$*/void test();/*$$*/
|
/*$*/void test();/*$$*/
|
||||||
};
|
};
|
||||||
|
|
||||||
//=
|
//=
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
void test();
|
void test();
|
||||||
};
|
};
|
||||||
|
@ -184,49 +166,45 @@ public:
|
||||||
|
|
||||||
//=
|
//=
|
||||||
|
|
||||||
|
void A::test() {
|
||||||
|
|
||||||
void A::test()
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
//!Implement in existing namespace
|
||||||
//!implement in existing namespace
|
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
namespace NameSpace
|
namespace Namespace {
|
||||||
{
|
|
||||||
class ClassInNamespace
|
class ClassInNamespace {
|
||||||
{
|
public:
|
||||||
public:
|
|
||||||
int test();
|
int test();
|
||||||
/*$*/void test2();/*$$*/
|
/*$*/void test2();/*$$*/
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
namespace NameSpace
|
namespace Namespace {
|
||||||
{
|
|
||||||
int ClassInNamespace::test()
|
int ClassInNamespace::test() {
|
||||||
{
|
|
||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
namespace NameSpace
|
namespace Namespace {
|
||||||
{
|
|
||||||
int ClassInNamespace::test()
|
int ClassInNamespace::test() {
|
||||||
{
|
return 5;
|
||||||
return 5;
|
}
|
||||||
}
|
|
||||||
|
void ClassInNamespace::test2() {
|
||||||
|
}
|
||||||
|
|
||||||
void ClassInNamespace::test2()
|
|
||||||
{}
|
|
||||||
}
|
}
|
||||||
//!virtual method in the middle of con/destructor, without parameters and void return value
|
//!virtual method in the middle of con/destructor, without parameters and void return value
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
||||||
|
@ -236,8 +214,7 @@ filename=A.h
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
/*$*/virtual void foo();/*$$*/
|
/*$*/virtual void foo();/*$$*/
|
||||||
|
@ -248,30 +225,25 @@ public:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void A::foo()
|
void A::foo() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//!implement a function at start of source file
|
//!Implement a function at start of source file
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
|
@ -279,18 +251,15 @@ filename=A.h
|
||||||
/*$*/void function();/*$$*/
|
/*$*/void function();/*$$*/
|
||||||
void function_with_impl();
|
void function_with_impl();
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
void function_with_impl()
|
void function_with_impl() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
void function()
|
void function() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void function_with_impl()
|
void function_with_impl() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
//!method at end, without parameters and void return value
|
//!Method at end, without parameters and void return value
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
|
@ -298,8 +267,7 @@ filename=A.h
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
/*$*/void foo();/*$$*/
|
/*$*/void foo();/*$$*/
|
||||||
|
@ -309,24 +277,20 @@ public:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void A::foo()
|
void A::foo() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//!Method at beginning, without parameters, void return value and const
|
||||||
//!method at beginning, without parameters, void return value and const
|
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
|
@ -334,8 +298,7 @@ filename=A.h
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
/*$*/void foo() const;/*$$*/
|
/*$*/void foo() const;/*$$*/
|
||||||
A();
|
A();
|
||||||
|
@ -345,22 +308,19 @@ public:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
void A::foo() const
|
void A::foo() const {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//!method with int return value
|
//!Method with int return value
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
|
@ -368,8 +328,7 @@ filename=A.h
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
/*$*/int foo();/*$$*/
|
/*$*/int foo();/*$$*/
|
||||||
|
@ -379,24 +338,20 @@ public:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//!Method with two int parameters
|
||||||
//!method with two int parameters
|
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
|
@ -404,8 +359,7 @@ filename=A.h
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
/*$*/int foo(int param1, int param2);/*$$*/
|
/*$*/int foo(int param1, int param2);/*$$*/
|
||||||
|
@ -415,59 +369,49 @@ public:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo(int param1, int param2)
|
int A::foo(int param1, int param2) {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//!Method defined in header
|
||||||
//!method defined in header
|
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
infos=1
|
infos=1
|
||||||
//@A.h
|
//@A.h
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
/*$*/void test();/*$$*/
|
/*$*/void test();/*$$*/
|
||||||
};
|
};
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
void test();
|
void test();
|
||||||
};
|
};
|
||||||
|
|
||||||
A::A()
|
A::A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void A::test()
|
inline void A::test() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//!Implement a function at end of source file
|
||||||
//!implement a function at end of source file
|
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
|
@ -475,113 +419,111 @@ filename=A.h
|
||||||
void function_with_impl();
|
void function_with_impl();
|
||||||
/*$*/void function();/*$$*/
|
/*$*/void function();/*$$*/
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
void function_with_impl()
|
void function_with_impl() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
void function_with_impl()
|
void function_with_impl() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void function()
|
void function() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//!Implement with namespace
|
||||||
//!implement with namespace
|
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
namespace NameSpace
|
namespace Namespace {
|
||||||
{
|
|
||||||
class ClassInNamespace
|
class ClassInNamespace {
|
||||||
{
|
public:
|
||||||
public:
|
|
||||||
int other_test();
|
int other_test();
|
||||||
/*$*/void test();/*$$*/
|
/*$*/void test();/*$$*/
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
void NameSpace::ClassInNamespace::other_test()
|
void Namespace::ClassInNamespace::other_test() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
void NameSpace::ClassInNamespace::other_test()
|
void Namespace::ClassInNamespace::other_test() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void NameSpace::ClassInNamespace::test()
|
void Namespace::ClassInNamespace::test() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//!Implement function within namespace
|
||||||
//!implement function within namespace
|
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
namespace OuterSpace {
|
namespace OuterSpace {
|
||||||
namespace NameSpace
|
namespace Namespace {
|
||||||
{
|
|
||||||
int test();
|
int test();
|
||||||
/*$*/int test2();/*$$*/
|
/*$*/int test2();/*$$*/
|
||||||
}
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
namespace OuterSpace {
|
namespace OuterSpace {
|
||||||
int NameSpace::test()
|
|
||||||
{
|
int Namespace::test() {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
namespace OuterSpace {
|
namespace OuterSpace {
|
||||||
int NameSpace::test()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
int NameSpace::test2()
|
int Namespace::test() {
|
||||||
{}
|
|
||||||
}
|
}
|
||||||
//!implement function within namespaces
|
|
||||||
|
int Namespace::test2() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
//!Implement function within namespaces
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
namespace OuterSpace {
|
namespace OuterSpace {
|
||||||
namespace NameSpace
|
namespace Namespace {
|
||||||
{
|
|
||||||
int test();
|
int test();
|
||||||
/*$*/int test2();/*$$*/
|
/*$*/int test2();/*$$*/
|
||||||
}
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
namespace OuterSpace {
|
namespace OuterSpace {
|
||||||
namespace NameSpace {
|
namespace Namespace {
|
||||||
int test()
|
|
||||||
{
|
int test() {
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
namespace OuterSpace {
|
namespace OuterSpace {
|
||||||
namespace NameSpace {
|
namespace Namespace {
|
||||||
int test()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
int test2()
|
int test() {
|
||||||
{}
|
}
|
||||||
}
|
|
||||||
|
int test2() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//!class template member functions with multiple templates
|
//!class template member functions with multiple templates
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
||||||
|
@ -589,43 +531,41 @@ namespace OuterSpace {
|
||||||
filename=A.h
|
filename=A.h
|
||||||
infos=1
|
infos=1
|
||||||
//@A.h
|
//@A.h
|
||||||
template<class T, class U> class A
|
template<class T, class U>
|
||||||
{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
/*$*/void test();/*$$*/
|
/*$*/void test();/*$$*/
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class T, class U> A<T,U>::A()
|
template<class T, class U>
|
||||||
{
|
A<T,U>::A() {
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
template<class T, class U> class A
|
template<class T, class U>
|
||||||
{
|
class A {
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
void test();
|
void test();
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class T, class U> A<T,U>::A()
|
template<class T, class U>
|
||||||
{
|
A<T,U>::A() {
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T, class U> inline void A<T,U>::test()
|
template<class T, class U>
|
||||||
{
|
inline void A<T, U>::test() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//!with default parameters
|
//!with default parameters
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
|
|
||||||
class Class
|
class Class {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
/*$*/void test(int param1, int param2 = 5, int param3 = 10);/*$$*/
|
/*$*/void test(int param1, int param2 = 5, int param3 = 10);/*$$*/
|
||||||
};
|
};
|
||||||
|
@ -637,20 +577,15 @@ public:
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
|
void Class::test(int param1, int param2, int param3) {
|
||||||
|
|
||||||
void Class::test(int param1, int param2, int param3)
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//!static method
|
//!static method
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
|
|
||||||
class Class
|
class Class {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
/*$*/static void test();/*$$*/
|
/*$*/static void test();/*$$*/
|
||||||
};
|
};
|
||||||
|
@ -662,12 +597,8 @@ public:
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
|
void Class::test() {
|
||||||
|
|
||||||
void Class::test()
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Bug 238253 Pointer refence of the return value lost
|
//! Bug 238253 Pointer refence of the return value lost
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -686,21 +617,16 @@ public:
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
|
int* TestClass::get(char* val) {
|
||||||
|
|
||||||
int *TestClass::get(char *val)
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Bug 238554 void parameters
|
//! Bug 238554 void parameters
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
|
|
||||||
class Test
|
class Test {
|
||||||
{
|
public:
|
||||||
public:
|
|
||||||
/*$*/void doNothing(void);/*$$*/
|
/*$*/void doNothing(void);/*$$*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -711,12 +637,8 @@ class Test
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
|
void Test::doNothing(void) {
|
||||||
|
|
||||||
void Test::doNothing(void)
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Bug 282989 Refactor->Implement method option doesn't qualify the name in the method definition with a fully qualified container class name
|
//! Bug 282989 Refactor->Implement method option doesn't qualify the name in the method definition with a fully qualified container class name
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -726,10 +648,12 @@ infos=1
|
||||||
#ifndef TESTCLASS_H_
|
#ifndef TESTCLASS_H_
|
||||||
#define TESTCLASS_H_
|
#define TESTCLASS_H_
|
||||||
|
|
||||||
namespace nspace{
|
namespace nspace {
|
||||||
|
|
||||||
class TestClass {
|
class TestClass {
|
||||||
void /*$*/testMethod()/*$$*/;
|
void /*$*/testMethod()/*$$*/;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TESTCLASS_H_ */
|
#endif /* TESTCLASS_H_ */
|
||||||
|
@ -738,18 +662,18 @@ void /*$*/testMethod()/*$$*/;
|
||||||
#ifndef TESTCLASS_H_
|
#ifndef TESTCLASS_H_
|
||||||
#define TESTCLASS_H_
|
#define TESTCLASS_H_
|
||||||
|
|
||||||
namespace nspace{
|
namespace nspace {
|
||||||
|
|
||||||
class TestClass {
|
class TestClass {
|
||||||
void testMethod();
|
void testMethod();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void nspace::TestClass::testMethod()
|
inline void nspace::TestClass::testMethod() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* TESTCLASS_H_ */
|
#endif /* TESTCLASS_H_ */
|
||||||
|
|
||||||
//!Bug 290110 Source-> Implement Method
|
//!Bug 290110 Source-> Implement Method
|
||||||
|
@ -768,6 +692,7 @@ public:
|
||||||
A();
|
A();
|
||||||
~A();
|
~A();
|
||||||
void testmethod(int x);
|
void testmethod(int x);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
class B {
|
class B {
|
||||||
public:
|
public:
|
||||||
|
@ -810,12 +735,10 @@ A::~A() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void n1::n2::A::B::testmethod2()
|
void n1::n2::A::B::testmethod2() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//!Bug 337040 - Insert definition in empty implementation file (.cxx)
|
//!Bug 337040 - Insert definition in empty implementation file (.cxx)
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -832,12 +755,8 @@ public:
|
||||||
|
|
||||||
//=
|
//=
|
||||||
|
|
||||||
|
void TestClass::foo() {
|
||||||
|
|
||||||
void TestClass::foo()
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//!Bug 355006 - NPE implementing template function
|
//!Bug 355006 - NPE implementing template function
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -845,15 +764,14 @@ filename=A.h
|
||||||
infos=1
|
infos=1
|
||||||
//@A.h
|
//@A.h
|
||||||
|
|
||||||
/*$*/template<typename T> void func(T&);/*$$*/
|
/*$*/template<typename T>
|
||||||
|
void func(T&);/*$$*/
|
||||||
//=
|
//=
|
||||||
|
|
||||||
template<typename T> void func(T&);
|
template<typename T>
|
||||||
|
void func(T&);
|
||||||
|
|
||||||
template<typename T> inline void func(T& )
|
template<typename T>
|
||||||
{
|
inline void func(T&) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,8 +17,7 @@ void freefunction();
|
||||||
|
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
void freefunction()
|
void freefunction() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//!FreefunctionFromImplToHeader
|
//!FreefunctionFromImplToHeader
|
||||||
|
@ -28,8 +27,7 @@ filename=A.cpp
|
||||||
newfilecreation=true
|
newfilecreation=true
|
||||||
newfiles=A.h
|
newfiles=A.h
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
void /*$*/freefunction/*$$*/()
|
void /*$*/freefunction/*$$*/() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
|
@ -40,8 +38,7 @@ void /*$*/freefunction/*$$*/()
|
||||||
//=
|
//=
|
||||||
|
|
||||||
|
|
||||||
void freefunction()
|
void freefunction() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,9 +14,7 @@ class A {
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
int member()
|
int member() {
|
||||||
{
|
|
||||||
return int();
|
return int();
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
|
@ -4,8 +4,7 @@
|
||||||
filename=A.h
|
filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
class A {
|
class A {
|
||||||
void /*$*/member/*$$*/()
|
void /*$*/member/*$$*/() {
|
||||||
{
|
|
||||||
// return comment
|
// return comment
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -15,13 +14,11 @@ class A {
|
||||||
void member();
|
void member();
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void A::member()
|
inline void A::member() {
|
||||||
{
|
|
||||||
// return comment
|
// return comment
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!ClassToHeaderTopCommentOrder
|
//!ClassToHeaderTopCommentOrder
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -30,8 +27,7 @@ filename=A.h
|
||||||
class A {
|
class A {
|
||||||
// First Top Comment
|
// First Top Comment
|
||||||
// Second Top Comment
|
// Second Top Comment
|
||||||
void /*$*/member/*$$*/()
|
void /*$*/member/*$$*/() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -42,12 +38,10 @@ class A {
|
||||||
void member();
|
void member();
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void A::member()
|
inline void A::member() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!ClassToHeaderCatchComment
|
//!ClassToHeaderCatchComment
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -57,7 +51,8 @@ class A {
|
||||||
void /*$*/member/*$$*/() try
|
void /*$*/member/*$$*/() try
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
} catch (int i) {
|
}
|
||||||
|
catch (int i) {
|
||||||
// catch comment
|
// catch comment
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -67,15 +62,13 @@ class A {
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void A::member()
|
inline void A::member()
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch(int i){
|
catch (int i) {
|
||||||
// catch comment
|
// catch comment
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!ClassToHeaderTopComment
|
//!ClassToHeaderTopComment
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -83,8 +76,7 @@ filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
class A {
|
class A {
|
||||||
// Top comment
|
// Top comment
|
||||||
void /*$*/member/*$$*/()
|
void /*$*/member/*$$*/() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -94,12 +86,10 @@ class A {
|
||||||
void member();
|
void member();
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void A::member()
|
inline void A::member() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!ClassToHeaderTemplateTopComment
|
//!ClassToHeaderTemplateTopComment
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -108,8 +98,7 @@ filename=A.h
|
||||||
class A {
|
class A {
|
||||||
// Top comment
|
// Top comment
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T /*$*/member/*$$*/()
|
T /*$*/member/*$$*/() {
|
||||||
{
|
|
||||||
return T();
|
return T();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -122,20 +111,18 @@ class A {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Top comment
|
// Top comment
|
||||||
template<typename T> inline T A::member()
|
template<typename T>
|
||||||
{
|
inline T A::member() {
|
||||||
return T();
|
return T();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!ClassToHeaderTrailingComment
|
//!ClassToHeaderTrailingComment
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
class A {
|
class A {
|
||||||
void /*$*/member/*$$*/()
|
void /*$*/member/*$$*/() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
} // Trailing comment
|
} // Trailing comment
|
||||||
};
|
};
|
||||||
|
@ -144,22 +131,21 @@ class A {
|
||||||
void member();
|
void member();
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void A::member()
|
inline void A::member() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
} // Trailing comment
|
} // Trailing comment
|
||||||
|
|
||||||
|
|
||||||
//!ClassToHeaderTrailingCommentWithTryBlock
|
//!ClassToHeaderTrailingCommentWithTryBlock
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
class A {
|
class A {
|
||||||
void /*$*/member/*$$*/() try
|
void /*$*/member/*$$*/()
|
||||||
{
|
try {
|
||||||
return;
|
return;
|
||||||
} catch (int e) {
|
}
|
||||||
|
catch (int e) {
|
||||||
} // Trailing comment
|
} // Trailing comment
|
||||||
};
|
};
|
||||||
//=
|
//=
|
||||||
|
@ -168,22 +154,20 @@ class A {
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void A::member()
|
inline void A::member()
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch(int e){
|
catch (int e) {
|
||||||
}
|
}
|
||||||
// Trailing comment
|
// Trailing comment
|
||||||
|
|
||||||
//!ClassToHeaderTrailingMultipleCommentsInTryBlock
|
//!ClassToHeaderTrailingMultipleCommentsInTryBlock
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
class A {
|
class A {
|
||||||
int /*$*/member/*$$*/() try
|
int /*$*/member/*$$*/()
|
||||||
{
|
try {
|
||||||
// aans
|
// aans
|
||||||
} /* one */ catch (int i) {
|
} /* one */ catch (int i) {
|
||||||
// zwaa
|
// zwaa
|
||||||
|
@ -197,15 +181,13 @@ class A {
|
||||||
};
|
};
|
||||||
|
|
||||||
inline int A::member()
|
inline int A::member()
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
// aans
|
// aans
|
||||||
} /* one */
|
} /* one */
|
||||||
catch(int i){
|
catch (int i) {
|
||||||
// zwaa
|
// zwaa
|
||||||
}
|
}
|
||||||
/* two */catch(int j){
|
/* two */catch (int j) {
|
||||||
// draa
|
// draa
|
||||||
}
|
}
|
||||||
/* three */
|
/* three */
|
||||||
|
|
||||||
|
|
|
@ -8,15 +8,15 @@ class A {
|
||||||
T /*$*/member/*$$*/();
|
T /*$*/member/*$$*/();
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T> inline T A<T>::member() {
|
template<typename T>
|
||||||
|
inline T A<T>::member() {
|
||||||
// body comment
|
// body comment
|
||||||
return T();
|
return T();
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class A {
|
class A {
|
||||||
T member()
|
T member() {
|
||||||
{
|
|
||||||
// body comment
|
// body comment
|
||||||
return T();
|
return T();
|
||||||
}
|
}
|
||||||
|
@ -38,8 +38,7 @@ class A {
|
||||||
// Third comment
|
// Third comment
|
||||||
// Fourth comment
|
// Fourth comment
|
||||||
template<typename T>
|
template<typename T>
|
||||||
inline T A<T>::member()
|
inline T A<T>::member() {
|
||||||
{
|
|
||||||
return T();
|
return T();
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
|
@ -49,8 +48,7 @@ class A {
|
||||||
// Fourth comment
|
// Fourth comment
|
||||||
// First comment
|
// First comment
|
||||||
// Second comment
|
// Second comment
|
||||||
T member()
|
T member() {
|
||||||
{
|
|
||||||
return T();
|
return T();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -68,27 +66,30 @@ class A {
|
||||||
T /*$*/member/*$$*/();
|
T /*$*/member/*$$*/();
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T> inline T A<T>::member() try {
|
template<typename T>
|
||||||
|
inline T A<T>::member()
|
||||||
|
try {
|
||||||
// body comment
|
// body comment
|
||||||
return T();
|
return T();
|
||||||
} catch(int e) {
|
}
|
||||||
|
catch (int e) {
|
||||||
// Catch 1
|
// Catch 1
|
||||||
} catch(int e) {
|
}
|
||||||
|
catch (int e) {
|
||||||
// Catch 2
|
// Catch 2
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class A {
|
class A {
|
||||||
T member()
|
T member()
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
// body comment
|
// body comment
|
||||||
return T();
|
return T();
|
||||||
}
|
}
|
||||||
catch(int e){
|
catch (int e) {
|
||||||
// Catch 1
|
// Catch 1
|
||||||
}
|
}
|
||||||
catch(int e){
|
catch (int e) {
|
||||||
// Catch 2
|
// Catch 2
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -118,13 +119,11 @@ template<typename S, typename T>
|
||||||
class A {
|
class A {
|
||||||
// Top Comment
|
// Top Comment
|
||||||
template<typename U, typename V>
|
template<typename U, typename V>
|
||||||
T member()
|
T member() {
|
||||||
{
|
|
||||||
// body comment
|
// body comment
|
||||||
return T();
|
return T();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 2nd Top Comment
|
// 2nd Top Comment
|
||||||
|
@ -140,15 +139,15 @@ class A {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Top comment
|
// Top comment
|
||||||
template<typename T> inline T A<T>::member() {
|
template<typename T>
|
||||||
|
inline T A<T>::member() {
|
||||||
return T();
|
return T();
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class A {
|
class A {
|
||||||
// Top comment
|
// Top comment
|
||||||
T member()
|
T member() {
|
||||||
{
|
|
||||||
return T();
|
return T();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -22,13 +22,10 @@ class A {
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
|
void A::member() {
|
||||||
void A::member()
|
|
||||||
{
|
|
||||||
// body comment
|
// body comment
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//!HeaderToImplTryCatchComment
|
//!HeaderToImplTryCatchComment
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -54,20 +51,17 @@ class A {
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
|
|
||||||
void A::member()
|
void A::member()
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
// body comment
|
// body comment
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch(/*1*/int e){
|
catch (/*1*/int e) {
|
||||||
/*2*/
|
/*2*/
|
||||||
}
|
}
|
||||||
catch(/*3*/int e){
|
catch (/*3*/int e) {
|
||||||
/*4*/
|
/*4*/
|
||||||
}
|
}
|
||||||
|
|
||||||
//!HeaderToImplTopComment
|
//!HeaderToImplTopComment
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -94,14 +88,11 @@ class A {
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
|
|
||||||
// Top comment
|
// Top comment
|
||||||
void A::member()
|
void A::member() {
|
||||||
{
|
|
||||||
// body comment
|
// body comment
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//!HeaderToImplFreeFuncTopComment
|
//!HeaderToImplFreeFuncTopComment
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -121,11 +112,7 @@ void member();
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Definition comment
|
// Definition comment
|
||||||
void member()
|
void member() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,7 @@ filename=A.cpp
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
void A::/*$*/member/*$$*/()
|
void A::/*$*/member/*$$*/() {
|
||||||
{
|
|
||||||
// body comment
|
// body comment
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -20,8 +19,7 @@ class A {
|
||||||
};
|
};
|
||||||
//=
|
//=
|
||||||
class A {
|
class A {
|
||||||
void member()
|
void member() {
|
||||||
{
|
|
||||||
// body comment
|
// body comment
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -34,8 +32,7 @@ filename=A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
// Definition comment
|
// Definition comment
|
||||||
void A::/*$*/member/*$$*/()
|
void A::/*$*/member/*$$*/() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
|
@ -50,8 +47,7 @@ class A {
|
||||||
//=
|
//=
|
||||||
class A {
|
class A {
|
||||||
// Definition comment
|
// Definition comment
|
||||||
void member()
|
void member() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -63,8 +59,7 @@ filename=A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
// Definition comment
|
// Definition comment
|
||||||
void A::/*$*/member/*$$*/() try
|
void A::/*$*/member/*$$*/() try {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
} /*1*/ catch (int e) { /*2*/ } /*3*/ catch (int e) { /*4*/ }
|
} /*1*/ catch (int e) { /*2*/ } /*3*/ catch (int e) { /*4*/ }
|
||||||
//=
|
//=
|
||||||
|
@ -80,14 +75,13 @@ class A {
|
||||||
class A {
|
class A {
|
||||||
// Definition comment
|
// Definition comment
|
||||||
void member()
|
void member()
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
} /*1*/
|
} /*1*/
|
||||||
catch(int e){
|
catch (int e) {
|
||||||
/*2*/
|
/*2*/
|
||||||
}
|
}
|
||||||
/*3*/catch(int e){
|
/*3*/catch (int e) {
|
||||||
/*4*/
|
/*4*/
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -98,8 +92,7 @@ filename=A.cpp
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
void /*$*/member/*$$*/()
|
void /*$*/member/*$$*/() {
|
||||||
{
|
|
||||||
// body comment
|
// body comment
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -111,14 +104,10 @@ void /*$*/member/*$$*/()
|
||||||
|
|
||||||
//=
|
//=
|
||||||
|
|
||||||
|
void member() {
|
||||||
|
|
||||||
void member()
|
|
||||||
{
|
|
||||||
// body comment
|
// body comment
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//!ImplToHeaderTopCommentWithoutDeclaration
|
//!ImplToHeaderTopCommentWithoutDeclaration
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -127,8 +116,7 @@ filename=A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
// Top comment
|
// Top comment
|
||||||
void /*$*/member/*$$*/()
|
void /*$*/member/*$$*/() {
|
||||||
{
|
|
||||||
// body comment
|
// body comment
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -141,12 +129,8 @@ void /*$*/member/*$$*/()
|
||||||
|
|
||||||
//=
|
//=
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Top comment
|
// Top comment
|
||||||
void member()
|
void member() {
|
||||||
{
|
|
||||||
// body comment
|
// body comment
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,12 +9,12 @@ class A {
|
||||||
private:
|
private:
|
||||||
int a;
|
int a;
|
||||||
int b;
|
int b;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/*$*/A/*$$*/(int x, int y)
|
/*$*/A/*$$*/(int x, int y) :
|
||||||
:a(x), b(y)
|
a(x), b(y) {
|
||||||
{}
|
}
|
||||||
~A()
|
~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
//=
|
//=
|
||||||
|
@ -24,19 +24,17 @@ class A {
|
||||||
private:
|
private:
|
||||||
int a;
|
int a;
|
||||||
int b;
|
int b;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
A(int x, int y);
|
A(int x, int y);
|
||||||
~A()
|
~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
inline A::A(int x, int y)
|
inline A::A(int x, int y) :
|
||||||
:a(x), b(y)
|
a(x), b(y) {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!TestConstructorToggleInHeaderToImplementation
|
//!TestConstructorToggleInHeaderToImplementation
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -48,16 +46,15 @@ class A {
|
||||||
private:
|
private:
|
||||||
int a;
|
int a;
|
||||||
int b;
|
int b;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
A(int x, int y);
|
A(int x, int y);
|
||||||
~A()
|
~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
inline A::/*$*/A/*$$*/(int x, int y)
|
inline A::/*$*/A/*$$*/(int x, int y) :
|
||||||
:a(x), b(y)
|
a(x), b(y) {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -66,10 +63,10 @@ class A {
|
||||||
private:
|
private:
|
||||||
int a;
|
int a;
|
||||||
int b;
|
int b;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
A(int x, int y);
|
A(int x, int y);
|
||||||
~A()
|
~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -87,12 +84,10 @@ int main() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
A::A(int x, int y)
|
A::A(int x, int y) :
|
||||||
:a(x), b(y)
|
a(x), b(y) {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!TestConstructorToggleInImplementationToClass
|
//!TestConstructorToggleInImplementationToClass
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -100,9 +95,8 @@ filename=A.cpp
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
A::/*$*/A/*$$*/(int x, int y)
|
A::/*$*/A/*$$*/(int x, int y) :
|
||||||
:a(x), b(y)
|
a(x), b(y) {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
@ -121,20 +115,17 @@ int main() {
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
A(int x, int y);
|
A(int x, int y);
|
||||||
~A()
|
~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
//=
|
//=
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
A(int x, int y)
|
A(int x, int y) :
|
||||||
:a(x), b(y)
|
a(x), b(y) {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
~A()
|
~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
//!TestDestructorToggleInClassToInHeader
|
//!TestDestructorToggleInClassToInHeader
|
||||||
|
@ -148,9 +139,10 @@ class A {
|
||||||
private:
|
private:
|
||||||
int a;
|
int a;
|
||||||
int b;
|
int b;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/*$*/~A/*$$*/()
|
/*$*/~A/*$$*/() {
|
||||||
{}
|
}
|
||||||
};
|
};
|
||||||
//=
|
//=
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -159,15 +151,14 @@ class A {
|
||||||
private:
|
private:
|
||||||
int a;
|
int a;
|
||||||
int b;
|
int b;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
~A();
|
~A();
|
||||||
};
|
};
|
||||||
|
|
||||||
inline A::~A()
|
inline A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!TestDestructorToggleInHeaderToImplementation
|
//!TestDestructorToggleInHeaderToImplementation
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -179,12 +170,12 @@ class A {
|
||||||
private:
|
private:
|
||||||
int a;
|
int a;
|
||||||
int b;
|
int b;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
~A();
|
~A();
|
||||||
};
|
};
|
||||||
|
|
||||||
inline /*$*/A::~A/*$$*/()
|
inline /*$*/A::~A/*$$*/() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -193,6 +184,7 @@ class A {
|
||||||
private:
|
private:
|
||||||
int a;
|
int a;
|
||||||
int b;
|
int b;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
~A();
|
~A();
|
||||||
};
|
};
|
||||||
|
@ -211,11 +203,9 @@ int main() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
A::~A()
|
A::~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!TestDestructorToggleInImplementationToClass
|
//!TestDestructorToggleInImplementationToClass
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -223,8 +213,7 @@ filename=A.cpp
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
/*$*/A::~A/*$$*/()
|
/*$*/A::~A/*$$*/() {
|
||||||
{
|
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
return;
|
return;
|
||||||
|
@ -245,20 +234,19 @@ int main() {
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
A(int x, int y)
|
A(int x, int y) :
|
||||||
:a(x), b(y)
|
a(x), b(y) {
|
||||||
{}
|
}
|
||||||
~A();
|
~A();
|
||||||
};
|
};
|
||||||
//=
|
//=
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
A(int x, int y)
|
A(int x, int y) :
|
||||||
:a(x), b(y)
|
a(x), b(y) {
|
||||||
{}
|
}
|
||||||
~A()
|
~A() {
|
||||||
{
|
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -6,8 +6,7 @@ filename=A.h
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
void /*$*/member/*$$*/(int a=0, int b=0)
|
void /*$*/member/*$$*/(int a = 0, int b = 0) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -15,15 +14,13 @@ class A {
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
void member(int a=0, int b=0);
|
void member(int a = 0, int b = 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void A::member(int a, int b)
|
inline void A::member(int a, int b) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!TestDefaultParameterInitializerInHeaderToImplementation
|
//!TestDefaultParameterInitializerInHeaderToImplementation
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -32,18 +29,17 @@ filename=A.h
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
void member(int a=0, int b=0);
|
void member(int a = 0, int b = 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void /*$*/A::member/*$$*/(int a, int b)
|
inline void /*$*/A::member/*$$*/(int a, int b) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
void member(int a=0, int b=0);
|
void member(int a = 0, int b = 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -60,12 +56,10 @@ int main() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void A::member(int a, int b)
|
void A::member(int a, int b) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!TestDefaultParameterInitializerInImplementationToClass
|
//!TestDefaultParameterInitializerInImplementationToClass
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -73,13 +67,11 @@ filename=A.cpp
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
void A::/*$*/member/*$$*/(int a, int b)
|
void A::/*$*/member/*$$*/(int a, int b) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
|
@ -87,8 +79,7 @@ int main()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//@A.h
|
//@A.h
|
||||||
|
@ -101,8 +92,7 @@ class A {
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
void member(int a = 0, int b = 0)
|
void member(int a = 0, int b = 0) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
|
@ -9,8 +9,7 @@ int main() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void N::A::/*$*/foo/*$$*/()
|
void N::A::/*$*/foo/*$$*/() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
|
@ -26,21 +25,24 @@ int main() {
|
||||||
#include <exception>
|
#include <exception>
|
||||||
|
|
||||||
namespace N {
|
namespace N {
|
||||||
class A {
|
|
||||||
|
class A {
|
||||||
void foo();
|
void foo();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <exception>
|
#include <exception>
|
||||||
|
|
||||||
namespace N {
|
namespace N {
|
||||||
class A {
|
|
||||||
void foo()
|
class A {
|
||||||
{
|
void foo() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
//!TestImplementationToClassWithDeclarationSelected
|
//!TestImplementationToClassWithDeclarationSelected
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
|
@ -51,9 +53,11 @@ filename=A.h
|
||||||
#include <exception>
|
#include <exception>
|
||||||
|
|
||||||
namespace N {
|
namespace N {
|
||||||
class A {
|
|
||||||
|
class A {
|
||||||
void /*$*/foo/*$$*/();
|
void /*$*/foo/*$$*/();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
|
@ -61,12 +65,13 @@ namespace N {
|
||||||
#include <exception>
|
#include <exception>
|
||||||
|
|
||||||
namespace N {
|
namespace N {
|
||||||
class A {
|
|
||||||
void foo()
|
class A {
|
||||||
{
|
void foo() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
|
@ -75,8 +80,8 @@ namespace N {
|
||||||
int main() {
|
int main() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
void N::A::foo()
|
|
||||||
{
|
void N::A::foo() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
|
@ -86,3 +91,4 @@ int main() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,9 @@ fatalerror=true
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
public:
|
public:
|
||||||
void foo()
|
void foo() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int /*$*/x/*$$*/;
|
int /*$*/x/*$$*/;
|
||||||
};
|
};
|
||||||
|
@ -28,8 +28,7 @@ public:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,8 +59,7 @@ class A {
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,26 +72,21 @@ fatalerror=true
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
void foo();
|
void foo();
|
||||||
void /*$*/foo/*$$*/()
|
void /*$*/foo/*$$*/() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void blah()
|
void blah() {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void A::foo()
|
inline void A::foo() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,8 +98,7 @@ fatalerror=true
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
void foo()
|
void foo() {
|
||||||
{
|
|
||||||
void /*$*/bar/*$$*/() {
|
void /*$*/bar/*$$*/() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,16 +9,16 @@ class A {
|
||||||
private:
|
private:
|
||||||
int a;
|
int a;
|
||||||
int b;
|
int b;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
A(int x, int y)
|
A(int x, int y) :
|
||||||
:a(x), b(y)
|
a(x), b(y) {
|
||||||
{}
|
}
|
||||||
~A()
|
~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
int /*$*/freeFunction/*$$*/(int *a, int & b) {
|
int /*$*/freeFunction/*$$*/(int* a, int& b) {
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
|
@ -28,16 +28,16 @@ class A {
|
||||||
private:
|
private:
|
||||||
int a;
|
int a;
|
||||||
int b;
|
int b;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
A(int x, int y)
|
A(int x, int y) :
|
||||||
:a(x), b(y)
|
a(x), b(y) {
|
||||||
{}
|
}
|
||||||
~A()
|
~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
int freeFunction(int *a, int & b);
|
int freeFunction(int* a, int& b);
|
||||||
|
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
@ -52,12 +52,10 @@ int main() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int freeFunction(int *a, int & b)
|
int freeFunction(int* a, int& b) {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!TestFreeFunctionToggleFromImplementationToHeaderWithDeclaration
|
//!TestFreeFunctionToggleFromImplementationToHeaderWithDeclaration
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -69,8 +67,7 @@ int main() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int /*$*/freeFunction/*$$*/(int *a, int & b)
|
int /*$*/freeFunction/*$$*/(int* a, int& b) {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
|
@ -88,16 +85,16 @@ class A {
|
||||||
private:
|
private:
|
||||||
int a;
|
int a;
|
||||||
int b;
|
int b;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
A(int x, int y)
|
A(int x, int y) :
|
||||||
:a(x), b(y)
|
a(x), b(y) {
|
||||||
{}
|
}
|
||||||
~A()
|
~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
int freeFunction(int *a, int & b);
|
int freeFunction(int* a, int& b);
|
||||||
//=
|
//=
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
@ -105,21 +102,19 @@ class A {
|
||||||
private:
|
private:
|
||||||
int a;
|
int a;
|
||||||
int b;
|
int b;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
A(int x, int y)
|
A(int x, int y) :
|
||||||
:a(x), b(y)
|
a(x), b(y) {
|
||||||
{}
|
}
|
||||||
~A()
|
~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
int freeFunction(int *a, int & b)
|
int freeFunction(int* a, int& b) {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!TestFreeFunctionToggleFromImplementationToHeaderWithOutDeclaration
|
//!TestFreeFunctionToggleFromImplementationToHeaderWithOutDeclaration
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -131,11 +126,11 @@ int main() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int /*$*/freeFunction/*$$*/(int *a, int & b)
|
int /*$*/freeFunction/*$$*/(int* a, int& b)
|
||||||
try {
|
try {
|
||||||
return 42;
|
return 42;
|
||||||
} catch (std::exception & e)
|
}
|
||||||
{
|
catch (std::exception& e) {
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
@ -152,12 +147,12 @@ class A {
|
||||||
private:
|
private:
|
||||||
int a;
|
int a;
|
||||||
int b;
|
int b;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
A(int x, int y)
|
A(int x, int y) :
|
||||||
:a(x), b(y)
|
a(x), b(y) {
|
||||||
{}
|
}
|
||||||
~A()
|
~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -168,32 +163,29 @@ class A {
|
||||||
private:
|
private:
|
||||||
int a;
|
int a;
|
||||||
int b;
|
int b;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
A(int x, int y)
|
A(int x, int y) :
|
||||||
:a(x), b(y)
|
a(x), b(y) {
|
||||||
{}
|
}
|
||||||
~A()
|
~A() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
int freeFunction(int *a, int & b)
|
int freeFunction(int* a, int& b)
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
catch(std::exception & e){
|
catch (std::exception& e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//!TestFreeFunction
|
//!TestFreeFunction
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
int /*$*/freeFunction/*$$*/()
|
int /*$*/freeFunction/*$$*/() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
|
@ -204,12 +196,9 @@ int freeFunction();
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
|
int freeFunction() {
|
||||||
int freeFunction()
|
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
//!TestQualifiedNameToggle
|
//!TestQualifiedNameToggle
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -218,18 +207,15 @@ fatalerror=true
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
int /*$*/A::freefunction/*$$*/()
|
int /*$*/A::freefunction/*$$*/() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
int A::freefunction()
|
int A::freefunction() {
|
||||||
{
|
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
//!TestNamespacedFreeFunction
|
//!TestNamespacedFreeFunction
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -241,10 +227,11 @@ filename=A.h
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
namespace N {
|
namespace N {
|
||||||
void /*$*/freefunction/*$$*/()
|
|
||||||
{
|
void /*$*/freefunction/*$$*/() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* A_H_ */
|
#endif /* A_H_ */
|
||||||
|
@ -255,7 +242,9 @@ namespace N {
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
namespace N {
|
namespace N {
|
||||||
void freefunction();
|
|
||||||
|
void freefunction();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* A_H_ */
|
#endif /* A_H_ */
|
||||||
|
@ -272,12 +261,11 @@ int main() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace N
|
namespace N {
|
||||||
{
|
|
||||||
void freefunction()
|
void freefunction() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,24 +7,28 @@ filename=A.h
|
||||||
#include <exception>
|
#include <exception>
|
||||||
|
|
||||||
namespace N {
|
namespace N {
|
||||||
class A {
|
|
||||||
|
class A {
|
||||||
void /*$*/foo/*$$*/() {
|
void /*$*/foo/*$$*/() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <exception>
|
#include <exception>
|
||||||
|
|
||||||
namespace N {
|
namespace N {
|
||||||
class A {
|
|
||||||
|
class A {
|
||||||
void foo();
|
void foo();
|
||||||
};
|
};
|
||||||
inline void A::foo()
|
|
||||||
{
|
inline void A::foo() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//!TestSimpleNamespaceInHeaderToImplementationWithinNSDefinition
|
//!TestSimpleNamespaceInHeaderToImplementationWithinNSDefinition
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
|
@ -35,22 +39,26 @@ filename=A.h
|
||||||
#include <exception>
|
#include <exception>
|
||||||
|
|
||||||
namespace N {
|
namespace N {
|
||||||
class A {
|
|
||||||
|
class A {
|
||||||
void foo();
|
void foo();
|
||||||
};
|
};
|
||||||
inline void A::/*$*/foo/*$$*/()
|
|
||||||
{
|
inline void A::/*$*/foo/*$$*/() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <exception>
|
#include <exception>
|
||||||
|
|
||||||
namespace N {
|
namespace N {
|
||||||
class A {
|
|
||||||
|
class A {
|
||||||
void foo();
|
void foo();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
@ -65,12 +73,11 @@ int main() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace N
|
namespace N {
|
||||||
{
|
|
||||||
void A::foo()
|
void A::foo() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,13 +90,14 @@ filename=A.h
|
||||||
#include <exception>
|
#include <exception>
|
||||||
|
|
||||||
namespace N {
|
namespace N {
|
||||||
class A {
|
|
||||||
|
class A {
|
||||||
void foo();
|
void foo();
|
||||||
};
|
};
|
||||||
inline void A::/*$*/foo/*$$*/()
|
|
||||||
{
|
inline void A::/*$*/foo/*$$*/() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
|
@ -97,9 +105,10 @@ namespace N {
|
||||||
#include <exception>
|
#include <exception>
|
||||||
|
|
||||||
namespace N {
|
namespace N {
|
||||||
class A {
|
|
||||||
|
class A {
|
||||||
void foo();
|
void foo();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
|
@ -109,8 +118,7 @@ int main() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace N
|
namespace N {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
@ -119,12 +127,11 @@ int main() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace N
|
namespace N {
|
||||||
{
|
|
||||||
void A::foo()
|
void A::foo() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//!TestSimpleNamespaceInHeaderToImplementationWithNamespaceQualifiedName
|
//!TestSimpleNamespaceInHeaderToImplementationWithNamespaceQualifiedName
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
|
@ -135,13 +142,14 @@ filename=A.h
|
||||||
#include <exception>
|
#include <exception>
|
||||||
|
|
||||||
namespace N {
|
namespace N {
|
||||||
class A {
|
|
||||||
|
class A {
|
||||||
void foo();
|
void foo();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void /*$*/N::A::foo/*$$*/()
|
inline void /*$*/N::A::foo/*$$*/() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
|
@ -149,9 +157,11 @@ inline void /*$*/N::A::foo/*$$*/()
|
||||||
#include <exception>
|
#include <exception>
|
||||||
|
|
||||||
namespace N {
|
namespace N {
|
||||||
class A {
|
|
||||||
|
class A {
|
||||||
void foo();
|
void foo();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -168,12 +178,11 @@ int main() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace N
|
namespace N {
|
||||||
{
|
|
||||||
void A::foo()
|
void A::foo() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,13 +193,11 @@ filename=A.cpp
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
void /*$*/N::A::foo/*$$*/()
|
void /*$*/N::A::foo/*$$*/() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
|
@ -198,28 +205,30 @@ int main()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//@A.h
|
//@A.h
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
namespace N {
|
namespace N {
|
||||||
class A {
|
|
||||||
|
class A {
|
||||||
void foo();
|
void foo();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
namespace N {
|
namespace N {
|
||||||
class A {
|
|
||||||
void foo()
|
class A {
|
||||||
{
|
void foo() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
//!TestRemoveEmptyNamespaceFromImplentation
|
//!TestRemoveEmptyNamespaceFromImplentation
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
|
@ -229,10 +238,11 @@ filename=A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
namespace N {
|
namespace N {
|
||||||
void /*$*/A::foo/*$$*/()
|
|
||||||
{
|
void /*$*/A::foo/*$$*/() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
@ -242,18 +252,21 @@ namespace N {
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
namespace N {
|
namespace N {
|
||||||
class A {
|
|
||||||
|
class A {
|
||||||
void foo();
|
void foo();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
namespace N {
|
namespace N {
|
||||||
class A {
|
|
||||||
void foo()
|
class A {
|
||||||
{
|
void foo() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
|
@ -21,12 +21,10 @@ class A {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void A::B::member(int a, int b)
|
inline void A::B::member(int a, int b) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!TestNestedClassInHeaderToImplementation
|
//!TestNestedClassInHeaderToImplementation
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -40,8 +38,7 @@ class A {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void A::B::/*$*/member/*$$*/(int a, int b)
|
inline void A::B::/*$*/member/*$$*/(int a, int b) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
|
@ -57,24 +54,20 @@ class A {
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void A::B::member(int a, int b)
|
void A::B::member(int a, int b) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!TestNestedClassInImplementationToClass
|
//!TestNestedClassInImplementationToClass
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -82,20 +75,17 @@ filename=A.cpp
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void A::B::/*$*/member/*$$*/(int a, int b)
|
void A::B::/*$*/member/*$$*/(int a, int b) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,8 +103,7 @@ class A {
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
class B {
|
class B {
|
||||||
void member(int a, int b)
|
void member(int a, int b) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -8,21 +8,17 @@ filename=A.h
|
||||||
class A {
|
class A {
|
||||||
public:
|
public:
|
||||||
void func1();
|
void func1();
|
||||||
void /*$*/func2/*$$*/()
|
void /*$*/func2/*$$*/() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
void func3();
|
void func3();
|
||||||
void func4()
|
void func4() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void A::func1()
|
inline void A::func1() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void A::func3()
|
inline void A::func3() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -32,21 +28,17 @@ public:
|
||||||
void func1();
|
void func1();
|
||||||
void func2();
|
void func2();
|
||||||
void func3();
|
void func3();
|
||||||
void func4()
|
void func4() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void A::func1()
|
inline void A::func1() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void A::func2()
|
inline void A::func2() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void A::func3()
|
inline void A::func3() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
//!TestCorrectOrderingInHeaderToImplementation
|
//!TestCorrectOrderingInHeaderToImplementation
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
|
@ -60,13 +52,11 @@ public:
|
||||||
void func1();
|
void func1();
|
||||||
void func2();
|
void func2();
|
||||||
void func3();
|
void func3();
|
||||||
void func4()
|
void func4() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void A::/*$*/func2/*$$*/()
|
inline void A::/*$*/func2/*$$*/() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,8 +68,7 @@ public:
|
||||||
void func1();
|
void func1();
|
||||||
void func2();
|
void func2();
|
||||||
void func3();
|
void func3();
|
||||||
void func4()
|
void func4() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -88,40 +77,33 @@ public:
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void A::func1()
|
void A::func1() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void A::func3()
|
void A::func3() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void A::func1()
|
void A::func1() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void A::func2()
|
void A::func2() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void A::func3()
|
void A::func3() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//!TestCorrectTemplateOrderingInClassToInHeader
|
//!TestCorrectTemplateOrderingInClassToInHeader
|
||||||
|
@ -135,20 +117,19 @@ template <typename T>
|
||||||
class A {
|
class A {
|
||||||
public:
|
public:
|
||||||
void func1();
|
void func1();
|
||||||
void /*$*/func2/*$$*/()
|
void /*$*/func2/*$$*/() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
void func3();
|
void func3();
|
||||||
void func4()
|
void func4() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T> inline void A<T>::func1()
|
template<typename T>
|
||||||
{
|
inline void A<T>::func1() {
|
||||||
}
|
}
|
||||||
template<typename T> inline void A<T>::func3()
|
|
||||||
{
|
template<typename T>
|
||||||
|
inline void A<T>::func3() {
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -159,20 +140,20 @@ public:
|
||||||
void func1();
|
void func1();
|
||||||
void func2();
|
void func2();
|
||||||
void func3();
|
void func3();
|
||||||
void func4()
|
void func4() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T> inline void A<T>::func1()
|
template<typename T>
|
||||||
{
|
inline void A<T>::func1() {
|
||||||
}
|
|
||||||
template<typename T> inline void A<T>::func2()
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T> inline void A<T>::func3()
|
template<typename T>
|
||||||
{
|
inline void A<T>::func2() {
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
inline void A<T>::func3() {
|
||||||
}
|
}
|
||||||
//!TestCorrectTemplateOrderingInHeaderToInClass
|
//!TestCorrectTemplateOrderingInHeaderToInClass
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
|
@ -187,19 +168,20 @@ public:
|
||||||
void func1();
|
void func1();
|
||||||
void func2();
|
void func2();
|
||||||
void func3();
|
void func3();
|
||||||
void func4()
|
void func4() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T> inline void A<T>::func1()
|
template<typename T>
|
||||||
{
|
inline void A<T>::func1() {
|
||||||
}
|
}
|
||||||
template<typename T> inline void A<T>::/*$*/func2/*$$*/()
|
|
||||||
{
|
template<typename T>
|
||||||
|
inline void A<T>::/*$*/func2/*$$*/() {
|
||||||
}
|
}
|
||||||
template<typename T> inline void A<T>::func3()
|
|
||||||
{
|
template<typename T>
|
||||||
|
inline void A<T>::func3() {
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -208,19 +190,19 @@ template <typename T>
|
||||||
class A {
|
class A {
|
||||||
public:
|
public:
|
||||||
void func1();
|
void func1();
|
||||||
void func2()
|
void func2() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
void func3();
|
void func3();
|
||||||
void func4()
|
void func4() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T> inline void A<T>::func1()
|
template<typename T>
|
||||||
{
|
inline void A<T>::func1() {
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T> inline void A<T>::func3()
|
|
||||||
{
|
|
||||||
|
template<typename T>
|
||||||
|
inline void A<T>::func3() {
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,8 +4,7 @@
|
||||||
filename=A.h
|
filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
class A {
|
class A {
|
||||||
void me/*$*//*$$*/mber()
|
void me/*$*//*$$*/mber() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -14,20 +13,17 @@ class A {
|
||||||
void member();
|
void member();
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void A::member()
|
inline void A::member() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!TestSubstringSelection
|
//!TestSubstringSelection
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
class A {
|
class A {
|
||||||
void m/*$*/e/*$$*/mber()
|
void m/*$*/e/*$$*/mber() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -36,20 +32,17 @@ class A {
|
||||||
void member();
|
void member();
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void A::member()
|
inline void A::member() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!TestBodySelection
|
//!TestBodySelection
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
class A {
|
class A {
|
||||||
void member()
|
void member() {
|
||||||
{
|
|
||||||
r/*$*//*$$*/eturn;
|
r/*$*//*$$*/eturn;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -58,20 +51,17 @@ class A {
|
||||||
void member();
|
void member();
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void A::member()
|
inline void A::member() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!TestBodySelectionWithConfusingName
|
//!TestBodySelectionWithConfusingName
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
class A {
|
class A {
|
||||||
void member()
|
void member() {
|
||||||
{
|
|
||||||
int /*$*/abcd/*$$*/ = 42;
|
int /*$*/abcd/*$$*/ = 42;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -81,21 +71,18 @@ class A {
|
||||||
void member();
|
void member();
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void A::member()
|
inline void A::member() {
|
||||||
{
|
|
||||||
int abcd = 42;
|
int abcd = 42;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!TestLeftBorderSelection
|
//!TestLeftBorderSelection
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
class A {
|
class A {
|
||||||
/*$*//*$$*/void member()
|
/*$*//*$$*/void member() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -104,20 +91,17 @@ class A {
|
||||||
void member();
|
void member();
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void A::member()
|
inline void A::member() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!TestRightBorderSelection
|
//!TestRightBorderSelection
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
class A {
|
class A {
|
||||||
void member()
|
void member() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}/*$*//*$$*/
|
}/*$*//*$$*/
|
||||||
};
|
};
|
||||||
|
@ -126,20 +110,17 @@ class A {
|
||||||
void member();
|
void member();
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void A::member()
|
inline void A::member() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!TestOverlappingSelection
|
//!TestOverlappingSelection
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
class A {
|
class A {
|
||||||
vo/*$*/id member()
|
vo/*$*/id member() {
|
||||||
{
|
|
||||||
ret/*$$*/urn;
|
ret/*$$*/urn;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -148,9 +129,7 @@ class A {
|
||||||
void member();
|
void member();
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void A::member()
|
inline void A::member() {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,10 +7,10 @@ filename=A.h
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
public:
|
public:
|
||||||
int /*$*/function/*$$*/()
|
int /*$*/function/*$$*/() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int a;
|
int a;
|
||||||
};
|
};
|
||||||
|
@ -20,16 +20,15 @@ private:
|
||||||
class A {
|
class A {
|
||||||
public:
|
public:
|
||||||
int function();
|
int function();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int a;
|
int a;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline int A::function()
|
inline int A::function() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!TestSimpleFunctionInHeaderToImplementation
|
//!TestSimpleFunctionInHeaderToImplementation
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -40,12 +39,12 @@ filename=A.h
|
||||||
class A {
|
class A {
|
||||||
public:
|
public:
|
||||||
int function();
|
int function();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int a;
|
int a;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline int A::/*$*/function/*$$*/()
|
inline int A::/*$*/function/*$$*/() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
|
@ -54,6 +53,7 @@ inline int A::/*$*/function/*$$*/()
|
||||||
class A {
|
class A {
|
||||||
public:
|
public:
|
||||||
int function();
|
int function();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int a;
|
int a;
|
||||||
};
|
};
|
||||||
|
@ -72,12 +72,10 @@ int main() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::function()
|
int A::function() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!TestSimpleFunctionInImplementationToInClass
|
//!TestSimpleFunctionInImplementationToInClass
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -85,13 +83,11 @@ filename=A.cpp
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
int A::/*$*/function/*$$*/()
|
int A::/*$*/function/*$$*/() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
|
@ -99,8 +95,7 @@ int main()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//@A.h
|
//@A.h
|
||||||
|
@ -109,6 +104,7 @@ int main()
|
||||||
class A {
|
class A {
|
||||||
public:
|
public:
|
||||||
int function();
|
int function();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int a;
|
int a;
|
||||||
};
|
};
|
||||||
|
@ -117,10 +113,10 @@ private:
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
public:
|
public:
|
||||||
int function()
|
int function() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int a;
|
int a;
|
||||||
};
|
};
|
||||||
|
@ -131,10 +127,11 @@ filename=MyClass.cpp
|
||||||
//@MyClass.cpp
|
//@MyClass.cpp
|
||||||
#include "MyClass.h"
|
#include "MyClass.h"
|
||||||
|
|
||||||
myClass::/*$*/myClass/*$$*/(int implname) : fVal(implname) {}
|
myClass::/*$*/myClass/*$$*/(int implname) :
|
||||||
|
fVal(implname) {
|
||||||
|
}
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
|
@ -142,8 +139,7 @@ int main()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//@MyClass.h
|
//@MyClass.h
|
||||||
|
@ -157,9 +153,8 @@ struct myClass {
|
||||||
|
|
||||||
struct myClass {
|
struct myClass {
|
||||||
int fVal;
|
int fVal;
|
||||||
myClass(int implname)
|
myClass(int implname) :
|
||||||
:fVal(implname)
|
fVal(implname) {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -170,10 +165,11 @@ filename=MyClass.cpp
|
||||||
//@MyClass.cpp
|
//@MyClass.cpp
|
||||||
#include "MyClass.h"
|
#include "MyClass.h"
|
||||||
|
|
||||||
myClass::/*$*/myClass/*$$*/(int implname) : fVal(implname) {}
|
myClass::/*$*/myClass/*$$*/(int implname) :
|
||||||
|
fVal(implname) {
|
||||||
|
}
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
|
@ -181,8 +177,7 @@ int main()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//@MyClass.h
|
//@MyClass.h
|
||||||
|
@ -196,9 +191,8 @@ struct myClass {
|
||||||
|
|
||||||
struct myClass {
|
struct myClass {
|
||||||
int fVal;
|
int fVal;
|
||||||
myClass(int implname)
|
myClass(int implname) :
|
||||||
:fVal(implname)
|
fVal(implname) {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,7 @@ filename=A.h
|
||||||
template <typename T, typename U>
|
template <typename T, typename U>
|
||||||
class A {
|
class A {
|
||||||
class B {
|
class B {
|
||||||
T /*$*/member/*$$*/()
|
T /*$*/member/*$$*/() {
|
||||||
{
|
|
||||||
return T();
|
return T();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -24,12 +23,11 @@ class A {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T, typename U> inline T A<T,U>::B::member()
|
template<typename T, typename U>
|
||||||
{
|
inline T A<T, U>::B::member() {
|
||||||
return T();
|
return T();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!TestTemplateFunctionInHeaderToInClass
|
//!TestTemplateFunctionInHeaderToInClass
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -42,11 +40,10 @@ class A {
|
||||||
class B {
|
class B {
|
||||||
T member();
|
T member();
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T> inline T A<T>::B::/*$*/member/*$$*/()
|
template<typename T>
|
||||||
{
|
inline T A<T>::B::/*$*/member/*$$*/() {
|
||||||
return T();
|
return T();
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
|
@ -55,12 +52,10 @@ template<typename T> inline T A<T>::B::/*$*/member/*$$*/()
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class A {
|
class A {
|
||||||
class B {
|
class B {
|
||||||
T member()
|
T member() {
|
||||||
{
|
|
||||||
return T();
|
return T();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -82,74 +77,65 @@ class A {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T> inline T A::foo()
|
template<typename T>
|
||||||
{
|
inline T A::foo() {
|
||||||
return T();
|
return T();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!TestComplexTemplateFunctionFromInClassToInheader
|
//!TestComplexTemplateFunctionFromInClassToInheader
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
template<typename T, typename S>
|
template<typename T, typename S>
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
template<typename U, typename V>
|
template<typename U, typename V>
|
||||||
void /*$*/foo/*$$*/(const U & u, const V &v)
|
void /*$*/foo/*$$*/(const U& u, const V& v) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
//=
|
//=
|
||||||
template<typename T, typename S>
|
template<typename T, typename S>
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
template<typename U, typename V>
|
template<typename U, typename V>
|
||||||
void foo(const U & u, const V &v);
|
void foo(const U& u, const V& v);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T, typename S> template<typename U, typename V> inline void A<T,S>::foo(const U & u, const V & v)
|
template<typename T, typename S>
|
||||||
{
|
template<typename U, typename V>
|
||||||
|
inline void A<T, S>::foo(const U& u, const V& v) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!TestComplexTemplateFunctionFromInHeaderToInClass
|
//!TestComplexTemplateFunctionFromInHeaderToInClass
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
filename=A.h
|
filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
template<typename T, typename S>
|
template<typename T, typename S>
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
template<typename U, typename V>
|
template<typename U, typename V>
|
||||||
void /*$*/foo/*$$*/(const U & u, const V &v);
|
void /*$*/foo/*$$*/(const U& u, const V& v);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T, typename S> template<typename U, typename V> inline void A<T,S>::foo(const U & u, const V & v)
|
template<typename T, typename S>
|
||||||
{
|
template<typename U, typename V>
|
||||||
|
inline void A<T,S>::foo(const U& u, const V& v) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
template<typename T, typename S>
|
template<typename T, typename S>
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
template<typename U, typename V>
|
template<typename U, typename V>
|
||||||
void foo(const U & u, const V &v)
|
void foo(const U& u, const V& v) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,11 +8,10 @@ filename=A.h
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
void /*$*/member/*$$*/(int a, int b)
|
void /*$*/member/*$$*/(int a, int b)
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
} catch (std::exception & e1)
|
}
|
||||||
{
|
catch (std::exception& e1){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -25,15 +24,13 @@ class A {
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void A::member(int a, int b)
|
inline void A::member(int a, int b)
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch(std::exception & e1){
|
catch (std::exception& e1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!TestTryCatchFromInHeaderToImplementation
|
//!TestTryCatchFromInHeaderToImplementation
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -47,11 +44,10 @@ class A {
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void /*$*/A::member/*$$*/(int a, int b)
|
inline void /*$*/A::member/*$$*/(int a, int b)
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch(std::exception & e1){
|
catch (std::exception& e1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
|
@ -77,15 +73,13 @@ int main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void A::member(int a, int b)
|
void A::member(int a, int b)
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch(std::exception & e1){
|
catch (std::exception& e1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!TestTryCatchFromInImplementationToClass
|
//!TestTryCatchFromInImplementationToClass
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -95,17 +89,14 @@ filename=A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
void A::/*$*/member/*$$*/()
|
void A::/*$*/member/*$$*/()
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch(std::exception & e1)
|
catch (std::exception& e1) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
|
@ -114,8 +105,7 @@ int main()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//@A.h
|
//@A.h
|
||||||
|
@ -129,11 +119,10 @@ class A {
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
void member()
|
void member()
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch(std::exception & e1){
|
catch (std::exception& e1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -147,14 +136,13 @@ filename=A.h
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
void /*$*/member/*$$*/(int a, int b)
|
void /*$*/member/*$$*/(int a, int b)
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
} catch (std::exception & e1)
|
}
|
||||||
{
|
catch (std::exception& e1) {
|
||||||
return;
|
return;
|
||||||
} catch (std::exception & e2)
|
}
|
||||||
{
|
catch (std::exception& e2) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -167,18 +155,16 @@ class A {
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void A::member(int a, int b)
|
inline void A::member(int a, int b)
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch(std::exception & e1){
|
catch (std::exception& e1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch(std::exception & e2){
|
catch (std::exception& e2) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!TestMultipleTryCatchFromInHeaderToImplementation
|
//!TestMultipleTryCatchFromInHeaderToImplementation
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -192,14 +178,13 @@ class A {
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void /*$*/A::member/*$$*/(int a, int b)
|
inline void /*$*/A::member/*$$*/(int a, int b)
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch(std::exception & e1){
|
catch (std::exception& e1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch(std::exception & e2){
|
catch (std::exception& e2) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
|
@ -225,18 +210,16 @@ int main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void A::member(int a, int b)
|
void A::member(int a, int b)
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch(std::exception & e1){
|
catch (std::exception& e1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch(std::exception & e2){
|
catch (std::exception& e2) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!TestMultipleTryCatchFromInImplementationToClass
|
//!TestMultipleTryCatchFromInImplementationToClass
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -246,21 +229,17 @@ filename=A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
void A::/*$*/member/*$$*/()
|
void A::/*$*/member/*$$*/()
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch(std::exception & e1)
|
catch (std::exception& e1) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch(std::exception & e2)
|
catch (std::exception& e2) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
|
@ -269,8 +248,7 @@ int main()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//@A.h
|
//@A.h
|
||||||
|
@ -284,14 +262,13 @@ class A {
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
void member()
|
void member()
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch(std::exception & e1){
|
catch (std::exception& e1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch(std::exception & e2){
|
catch (std::exception& e2) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
|
@ -5,8 +5,7 @@ filename=A.h
|
||||||
//@A.h
|
//@A.h
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
virtual int /*$*/foo/*$$*/()
|
virtual int /*$*/foo/*$$*/() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -16,12 +15,10 @@ class A {
|
||||||
virtual int foo();
|
virtual int foo();
|
||||||
};
|
};
|
||||||
|
|
||||||
inline int A::foo()
|
inline int A::foo() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!TestVirtualSpecifierFromInHeaderToImplementation
|
//!TestVirtualSpecifierFromInHeaderToImplementation
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//%CPP
|
//%CPP
|
||||||
|
@ -33,8 +30,7 @@ class A {
|
||||||
virtual int /*$*/foo/*$$*/();
|
virtual int /*$*/foo/*$$*/();
|
||||||
};
|
};
|
||||||
|
|
||||||
inline int A::foo()
|
inline int A::foo() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
|
@ -47,24 +43,20 @@ class A {
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!TestVirtualSpecifierFromImplementationToHeader
|
//!TestVirtualSpecifierFromImplementationToHeader
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.togglefunction.ToggleRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -77,28 +69,24 @@ class A {
|
||||||
//=
|
//=
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
virtual int foo()
|
virtual int foo() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
//@A.cpp
|
//@A.cpp
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A::foo()
|
int A::foo() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//=
|
//=
|
||||||
#include "A.h"
|
#include "A.h"
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,7 @@ offset=27
|
||||||
#ifndef A_H_
|
#ifndef A_H_
|
||||||
#define A_H_
|
#define A_H_
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
void foo();
|
void foo();
|
||||||
|
@ -25,8 +24,7 @@ offset=0
|
||||||
//@A.h
|
//@A.h
|
||||||
typedef int nummere;
|
typedef int nummere;
|
||||||
|
|
||||||
class A
|
class A {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
A();
|
A();
|
||||||
};
|
};
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class ExtractFunctionTestSuite extends TestSuite {
|
||||||
suite.addTest(RefactoringTester.suite("ExtractMethodPreprocessorRefactoringTests", "resources/refactoring/ExtractMethodPreprocessor.rts"));
|
suite.addTest(RefactoringTester.suite("ExtractMethodPreprocessorRefactoringTests", "resources/refactoring/ExtractMethodPreprocessor.rts"));
|
||||||
suite.addTest(RefactoringTester.suite("Extract Function Templates Tests", "resources/refactoring/ExtractFunctionTemplates.rts"));
|
suite.addTest(RefactoringTester.suite("Extract Function Templates Tests", "resources/refactoring/ExtractFunctionTemplates.rts"));
|
||||||
suite.addTest(RefactoringTester.suite("Extract Method History Test", "resources/refactoring/ExtractMethodHistory.rts"));
|
suite.addTest(RefactoringTester.suite("Extract Method History Test", "resources/refactoring/ExtractMethodHistory.rts"));
|
||||||
suite.addTest(RefactoringTester.suite("Extract Function Dublicates Test", "resources/refactoring/ExtractMethodDuplicates.rts"));
|
suite.addTest(RefactoringTester.suite("Extract Function Duplicates Test", "resources/refactoring/ExtractMethodDuplicates.rts"));
|
||||||
return suite;
|
return suite;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -885,7 +885,7 @@ public class ExtractFunctionRefactoring extends CRefactoring {
|
||||||
arguments.put(CRefactoringDescription.SELECTION, region.getOffset() + "," + region.getLength()); //$NON-NLS-1$
|
arguments.put(CRefactoringDescription.SELECTION, region.getOffset() + "," + region.getLength()); //$NON-NLS-1$
|
||||||
arguments.put(ExtractFunctionRefactoringDescription.NAME, info.getMethodName());
|
arguments.put(ExtractFunctionRefactoringDescription.NAME, info.getMethodName());
|
||||||
arguments.put(ExtractFunctionRefactoringDescription.VISIBILITY, info.getVisibility().toString());
|
arguments.put(ExtractFunctionRefactoringDescription.VISIBILITY, info.getVisibility().toString());
|
||||||
arguments.put(ExtractFunctionRefactoringDescription.REPLACE_DUBLICATES, Boolean.toString(info.isReplaceDuplicates()));
|
arguments.put(ExtractFunctionRefactoringDescription.REPLACE_DUPLICATES, Boolean.toString(info.isReplaceDuplicates()));
|
||||||
return arguments;
|
return arguments;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ import org.eclipse.cdt.internal.ui.refactoring.utils.VisibilityEnum;
|
||||||
public class ExtractFunctionRefactoringDescription extends CRefactoringDescription {
|
public class ExtractFunctionRefactoringDescription extends CRefactoringDescription {
|
||||||
protected static final String NAME = "name"; //$NON-NLS-1$
|
protected static final String NAME = "name"; //$NON-NLS-1$
|
||||||
protected static final String VISIBILITY = "visibility"; //$NON-NLS-1$
|
protected static final String VISIBILITY = "visibility"; //$NON-NLS-1$
|
||||||
protected static final String REPLACE_DUBLICATES = "replaceDuplicates"; //$NON-NLS-1$
|
protected static final String REPLACE_DUPLICATES = "replaceDuplicates"; //$NON-NLS-1$
|
||||||
|
|
||||||
public ExtractFunctionRefactoringDescription(String project, String description,
|
public ExtractFunctionRefactoringDescription(String project, String description,
|
||||||
String comment, Map<String, String> arguments) {
|
String comment, Map<String, String> arguments) {
|
||||||
|
@ -47,7 +47,7 @@ public class ExtractFunctionRefactoringDescription extends CRefactoringDescripti
|
||||||
|
|
||||||
info.setMethodName(arguments.get(NAME));
|
info.setMethodName(arguments.get(NAME));
|
||||||
info.setVisibility(VisibilityEnum.getEnumForStringRepresentation(arguments.get(VISIBILITY)));
|
info.setVisibility(VisibilityEnum.getEnumForStringRepresentation(arguments.get(VISIBILITY)));
|
||||||
info.setReplaceDuplicates(Boolean.parseBoolean(arguments.get(REPLACE_DUBLICATES)));
|
info.setReplaceDuplicates(Boolean.parseBoolean(arguments.get(REPLACE_DUPLICATES)));
|
||||||
|
|
||||||
proj = getCProject();
|
proj = getCProject();
|
||||||
file = getFile();
|
file = getFile();
|
||||||
|
|
Loading…
Add table
Reference in a new issue