1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

replace selection marker, test code is now valid cpp code.

This commit is contained in:
Emanuel Graf 2008-08-27 13:27:24 +00:00
parent 94419b71d1
commit 45e948890f
9 changed files with 155 additions and 155 deletions

View file

@ -46,7 +46,7 @@ A::~A()
int A::foo()
{
return //$42$//; //Hallo
return /*$*/42/*$$*/; //Hallo
}
void A::bar()
@ -126,7 +126,7 @@ A::~A()
int A::foo()
{
//Hallo
return //$42$//;
return /*$*/42/*$$*/;
}
void A::bar()
@ -206,7 +206,7 @@ A::~A()
float A::foo()
{
return //$42.0$//;
return /*$*/42.0/*$$*/;
}
void A::bar()
@ -287,7 +287,7 @@ int A::foo()
int bar()
{
return //$42$//;
return /*$*/42/*$$*/;
}
@ -364,7 +364,7 @@ A::~A()
int A::foo()
{
return //$42$//;
return /*$*/42/*$$*/;
}
//=
@ -430,7 +430,7 @@ A::~A()
int A::foo()
{
return //$42$//;
return /*$*/42/*$$*/;
}
//=

View file

@ -25,7 +25,7 @@ class Test
void Test::test()
{
if(//$5 == 3 + 2$//) {
if(/*$*/5 == 3 + 2/*$$*/) {
//...
}
}
@ -73,7 +73,7 @@ class Test
void Test::test()
{
int num = 1;
if(//$5 != 3 + num$//) {
if(/*$*/5 != 3 + num/*$$*/) {
//...
}
}
@ -123,7 +123,7 @@ void Test::test()
{
int five = 5;
int six = 6;
int result = //$five + six$//;
int result = /*$*/five + six/*$$*/;
}
//=
@ -174,7 +174,7 @@ void Test::test()
{
helper s1 = "a";
helper s2 = "b";
helper result = //$s1 + s2$//;
helper result = /*$*/s1 + s2/*$$*/;
}
//=
@ -227,7 +227,7 @@ void Test::test()
{
new_helper s1 = "a";
new_helper s2 = "b";
new_helper result = //$s1 + s2$//;
new_helper result = /*$*/s1 + s2/*$$*/;
}
//=
@ -258,7 +258,7 @@ struct helper {};
int main(int argc, char** argv)
{
helper* h = //$new helper$//;
helper* h = /*$*/new helper/*$$*/;
return 0;
}
//=
@ -293,7 +293,7 @@ string join(string s1, char* s2)
int main()
{
string hello = "Hello";
cout << //$join(hello, "World")$// << endl;
cout << /*$*/join(hello, "World")/*$$*/ << endl;
}
//=
class string {};
@ -332,7 +332,7 @@ class Klass
void test()
{
other o;
this->set(//$o.value()$//);
this->set(/*$*/o.value()/*$$*/);
}
};
@ -372,7 +372,7 @@ Cursor* contains(const Cursor& pos);
int main() {
Cursor c;
contains(//$contains(c)$//);
contains(/*$*/contains(c)/*$$*/);
}
//=
@ -407,7 +407,7 @@ Cursor* contains(const Cursor& pos)
int main() {
Cursor c;
contains(//$contains(c)$//);
contains(/*$*/contains(c)/*$$*/);
}
//=

View file

@ -8,8 +8,8 @@ int tempFunct(){
T i;
i = 0;
//$i++;
i+=3;$//
/*$*/i++;
i+=3;/*$$*/
return 0;
}
@ -41,8 +41,8 @@ void test(){
template <typename T>
int tempFunct(T p){
//$++p;
p + 4;$//
/*$*/++p;
p + 4;/*$$*/
return 0;
}
@ -69,9 +69,9 @@ void test(){
template <typename T>
int tempFunct(){
//$T p;
/*$*/T p;
p = 0;
p + 4;$//
p + 4;/*$$*/
p + 2;
return 0;
}

View file

@ -47,9 +47,9 @@ A::~A()
}
int A::foo()
{
//$int i = 2;
/*$*/int i = 2;
++i;
help();$//
help();/*$$*/
return i;
}
@ -138,8 +138,8 @@ int A::foo()
{
int i = 2;
//comment
//$++i;
help();$//
/*$*/++i;
help();/*$$*/
return i;
}
@ -191,7 +191,7 @@ int main(){
int i;
// Comment
//$i= 7;$//
/*$*/i= 7;/*$$*/
return i;
}
@ -222,7 +222,7 @@ returnparameterindex=0
int main(){
int i;
//$i= 7;$// // Comment
/*$*/i= 7;/*$$*/ // Comment
return i;
}
@ -280,11 +280,11 @@ A::~A()
int A::foo()
{
//$int o = 1;
/*$*/int o = 1;
int i = 2;
++i;
o++;
help();$//
help();/*$$*/
o++;
return i;
}int A::help()
@ -347,8 +347,8 @@ A::~A()
}
void A::foo()
{
//$b = new B();
help();$//
/*$*/b = new B();
help();/*$$*/
}
int A::help()
@ -450,8 +450,8 @@ A::~A()
}
void A::foo()
{
//$b = new B();
help();$//
/*$*/b = new B();
help();/*$$*/
}
int A::help()
@ -550,9 +550,9 @@ A::~A()
int A::foo()
{
int i = 2;
//$++i;
/*$*/++i;
i += ZWO;
help();$//
help();/*$$*/
return i;
}
@ -644,9 +644,9 @@ A::~A()
int A::foo()
{
int i = 2;
//$++i;
/*$*/++i;
i = ADD(i, 42);
help();$//
help();/*$$*/
return i;
}
@ -736,8 +736,8 @@ A::~A()
int A::foo()
{
int* i = new int(2);
//$++*i;
help();$//
/*$*/++*i;
help();/*$$*/
return *i;
}
@ -824,9 +824,9 @@ A::~A()
int A::foo()
{
int* i = new int(2);
//$++*i;
/*$*/++*i;
help();
//A end-comment$//
//A end-comment/*$$*/
return *i;
}
@ -915,8 +915,8 @@ int A::foo()
{
//A beautiful comment
int* i = new int(2);
//$++*i;
help();$//
/*$*/++*i;
help();/*$$*/
return *i;
}
@ -1007,8 +1007,8 @@ A::~A()
int A::foo()
{
int i = 2;
//$++i;
help();$//
/*$*/++i;
help();/*$$*/
return i;
}
@ -1100,9 +1100,9 @@ int A::foo()
{
int i = 2;
int b = i;
//$++i;
/*$*/++i;
i = i + b;
help();$//
help();/*$$*/
++b;
return i;
}
@ -1200,10 +1200,10 @@ int A::foo()
float x = i;
B* b = new B();
int y = x + i;
//$++i;
/*$*/++i;
b->hello(y);
i = i + x;
help();$//
help();/*$$*/
++x;
return i;
}
@ -1308,10 +1308,10 @@ int A::foo()
float x = i;
B* b = new B();
int y = x + i;
//$++i;
/*$*/++i;
b->hello(y);
i = i + x;
help();$//
help();/*$$*/
++x;
return i;
}
@ -1430,10 +1430,10 @@ int A::foo()
float x = i;
B* b = new B();
int y = x + i;
//$++i;
/*$*/++i;
b->hello(y);
i = i + x;
help();$//
help();/*$$*/
b->hello(y);
++x;
return i;
@ -1554,10 +1554,10 @@ int A::foo()
float x = i;
B* b = new B();
int y = x + i;
//$++i;
/*$*/++i;
b->hello(y);
i = i + x;
help();$//
help();/*$$*/
b->hello(y);
++x;
return i;
@ -1669,8 +1669,8 @@ A::~A()
int A::foo()
{
int i = 2;
//$++i;
help();$//
/*$*/++i;
help();/*$$*/
return i;
}
@ -1765,8 +1765,8 @@ A::~A()
int A::foo()
{
int i = 2;
//$++i;
help();$//
/*$*/++i;
help();/*$$*/
return i;
}
@ -1861,8 +1861,8 @@ A::~A()
int A::foo() const
{
int i = 2;
//$++i;
help();$//
/*$*/++i;
help();/*$$*/
return i;
}
@ -1915,10 +1915,10 @@ methodname=loop
void method()
{
//$for (int var = 0; var < 100; ++var) {
/*$*/for (int var = 0; var < 100; ++var) {
if(var < 50)
continue;
}$//
}/*$$*/
}
//=
@ -1944,8 +1944,8 @@ fatalerror=true
void method()
{
//$if(true)
return;$//
/*$*/if(true)
return;/*$$*/
//unreachable
}
//!test if we don't allow to extract 'continue' Bug #53
@ -1958,8 +1958,8 @@ filename=A.h
void function()
{
for (int var = 0; var < 100; ++var) {
//$if(var < 50)
continue;$//
/*$*/if(var < 50)
continue;/*$$*/
}
}
@ -1974,11 +1974,11 @@ methodname=runTest
void testFuerRainer(){
int i=int();
//$++i;
/*$*/++i;
//Leading Comment
ASSERT (i);
//Trailling Comment
--i;$//
--i;/*$$*/
}
//=
@ -2010,9 +2010,9 @@ methodname=runTest
void testFuerRainer(){
int i=int();
//$++i;
/*$*/++i;
ASSERT (i);
--i;$//
--i;/*$$*/
}
//=
@ -2045,8 +2045,8 @@ int const INITIAL_CAPACITY = 10;
int main(){
int m_capacity;
//$m_capacity += INITIAL_CAPACITY;
string* newElements = new string[m_capacity];$//
/*$*/m_capacity += INITIAL_CAPACITY;
string* newElements = new string[m_capacity];/*$$*/
newElements[0] = "s";
}
@ -2121,7 +2121,7 @@ int A::foo(int& a)
{
int b = 7;
int c = 8;
//$a = b + c;$//
/*$*/a = b + c;/*$$*/
return a;
}
//=
@ -2203,7 +2203,7 @@ Test::~Test() {
void Test::test()
{
RetType v = //$RetType()$//;
RetType v = /*$*/RetType()/*$$*/;
}
//=

View file

@ -50,9 +50,9 @@ A::~A()
int A::foo()
{
int ii = 2;
//$++ii;
/*$*/++ii;
ii = ADD(ii, 42);
help();$//
help();/*$$*/
return ii;
}
@ -146,9 +146,9 @@ int A::foo()
{
int i = 2;
int b = 42;
//$++i;
/*$*/++i;
help();
ADD(b);$//
ADD(b);/*$$*/
b += 2;
return i;
}
@ -248,8 +248,8 @@ int A::foo()
int i = 2;
int bb = 42;
++i;
//$ADD(bb);
ADD(bb);$//
/*$*/ADD(bb);
ADD(bb);/*$$*/
bb += 2;
return i;
}

View file

@ -45,7 +45,7 @@ public:
void Print();
int //$SocSecNo$//();
int /*$*/SocSecNo/*$$*/();
int GetUniqueId();
@ -159,7 +159,7 @@ namespace Personal {
void Print();
int //$SocSecNo$//();
int /*$*/SocSecNo/*$$*/();
int GetUniqueId();
@ -277,7 +277,7 @@ public:
void Print();
int //$SocSecNo$//();
int /*$*/SocSecNo/*$$*/();
int GetUniqueId();
@ -393,7 +393,7 @@ public:
void Print();
int //$SocSecNo$//();
int /*$*/SocSecNo/*$$*/();
int GetUniqueId();
@ -514,7 +514,7 @@ public:
void Print();
int //$SocSecNo$//();
int /*$*/SocSecNo/*$$*/();
int GetUniqueId();
@ -605,7 +605,7 @@ class GaS {
public:
GaS();
virtual ~GaS();
bool //$isOk$//;
bool /*$*/isOk/*$$*/;
void methode2();
private:
@ -662,7 +662,7 @@ setters=id
class Person {
private:
int //$id$//;
int /*$*/id/*$$*/;
};
#endif /*C_H_*/
@ -706,7 +706,7 @@ setters=i
//comment1
class test
{
int //$i$//; //comment2
int /*$*/i/*$$*/; //comment2
char* b;
//comment3
};
@ -758,7 +758,7 @@ fatalerror=true
//comment1
class test
{
void //$test$//();
void /*$*/test/*$$*/();
//comment3
};

View file

@ -11,7 +11,7 @@ filename=A.h
class A{
public:
A();
//$void method2();$//
/*$*/void method2();/*$$*/
std::string toString();
private:
int i;
@ -50,7 +50,7 @@ class A{
public:
A();
//Kommentar
//$void method2();$//
/*$*/void method2();/*$$*/
std::string toString();
private:
int i;
@ -90,7 +90,7 @@ class A{
public:
A();
/*Kommentar*/
//$void method2();$//
/*$*/void method2();/*$$*/
std::string toString();
private:
@ -130,7 +130,7 @@ filename=A.h
class A{
public:
A();
//$void method2();$////Kommentar
/*$*/void method2();/*$$*///Kommentar
std::string toString();
private:
int i;
@ -168,7 +168,7 @@ filename=A.h
class A{
public:
A();
//$void method2();$///*Kommentar*/
/*$*/void method2();/*$$*//*Kommentar*/
std::string toString();
private:
int i;
@ -208,7 +208,7 @@ public:
A();
//Kommentar
//$void method2();$//
/*$*/void method2();/*$$*/
std::string toString();
private:
int i;
@ -249,7 +249,7 @@ public:
A();
/*Kommentar*/
//$void method2();$//
/*$*/void method2();/*$$*/
std::string toString();
private:
int i;
@ -288,7 +288,7 @@ filename=A.h
class A{
public:
A();
//$void method2();$////Kommentar
/*$*/void method2();/*$$*///Kommentar
std::string toString();
private:
int i;
@ -326,7 +326,7 @@ filename=A.h
class A{
public:
A();
//$void method2();$///*Kommentar*/
/*$*/void method2();/*$$*//*Kommentar*/
std::string toString();
private:
@ -366,7 +366,7 @@ public:
/*
* Kommentar
*/
//$void method2();$//
/*$*/void method2();/*$$*/
std::string toString();
private:
int i;
@ -405,7 +405,7 @@ filename=A.h
class A{
public:
A();
//$void method2();$// /*
/*$*/void method2();/*$$*/ /*
* Kommentar
*/
std::string toString();
@ -450,7 +450,7 @@ public:
/*
* Davor
*/
//$void method2();$// /*
/*$*/void method2();/*$$*/ /*
* Kommentar
*/
std::string toString();
@ -496,7 +496,7 @@ class A{
public:
A();
/*123*/
//$void method2();$////TEST
/*$*/void method2();/*$$*///TEST
std::string toString();
private:
int i;
@ -536,7 +536,7 @@ class A{
public:
A();
/*123*/
//$void method2();$///*TEST*/
/*$*/void method2();/*$$*//*TEST*/
std::string toString();
private:
int i;
@ -573,7 +573,7 @@ errors=1
class A{
private:
//$void method2();$//
/*$*/void method2();/*$$*/
};
#endif /*A_H_*/
@ -603,7 +603,7 @@ filename=A.h
class A{
public:
//$void method1();$//
/*$*/void method1();/*$$*/
void method2();
};
@ -636,7 +636,7 @@ filename=A.h
class A{
public:
//$void method1();$//void method2();
/*$*/void method1();/*$$*/void method2();
};
#endif /*A_H_*/
@ -669,7 +669,7 @@ filename=A.h
class A{
public:
//Kommentar
//$void method1();$//
/*$*/void method1();/*$$*/
void method2();
};
@ -704,7 +704,7 @@ filename=A.h
class A{
public:
//Kommentar
//$void method1();$//void method2();
/*$*/void method1();/*$$*/void method2();
};
#endif /*A_H_*/
@ -764,7 +764,7 @@ private:
//@A.cpp
#include "A.h"
void A:://$method2$//()
void A::/*$*/method2/*$$*/()
{
}
@ -809,7 +809,7 @@ private:
//@A.cpp
#include "A.h"
void A:://$method2$//()
void A::/*$*/method2/*$$*/()
{
}
@ -825,7 +825,7 @@ class HideMethod {
public:
HideMethod();
virtual ~HideMethod();
void //$methode2$//();
void /*$*/methode2/*$$*/();
void methode3()
{
methode2();
@ -866,7 +866,7 @@ class HideMethod {
public:
HideMethod();
virtual ~HideMethod();
void //$methode2$//();
void /*$*/methode2/*$$*/();
void methode3();
};
@ -940,7 +940,7 @@ class HideMethod {
public:
HideMethod();
virtual ~HideMethod();
void //$methode2$//();
void /*$*/methode2/*$$*/();
void methode3();
};
@ -990,7 +990,7 @@ class HideMethod {
public:
HideMethod();
virtual ~HideMethod();
void //$methode2$//();
void /*$*/methode2/*$$*/();
void methode3();
};
@ -1106,7 +1106,7 @@ HideMethod::~HideMethod() {
// TODO Auto-generated destructor stub
}
void HideMethod:://$methode2$//() {
void HideMethod::/*$*/methode2/*$$*/() {
//do nothing
}
@ -1147,7 +1147,7 @@ filename=A.h
class A{
public:
//$void method2();$//
/*$*/void method2();/*$$*/
};
#endif /*A_H_*/
@ -1178,7 +1178,7 @@ errors=1
#include <iostream>
class A{
//$void method2();$//
/*$*/void method2();/*$$*/
};
#endif /*A_H_*/
@ -1206,7 +1206,7 @@ filename=A.h
#include <iostream>
struct A{
//$void method2();$//
/*$*/void method2();/*$$*/
};
#endif /*A_H_*/
@ -1237,7 +1237,7 @@ struct other
class Klass
{
public:
void //$set$//(bool b){}
void /*$*/set/*$$*/(bool b){}
void test()
{
other o;
@ -1283,7 +1283,7 @@ public:
void test()
{
other o;
this->//$set$//(o.value());
this->/*$*/set/*$$*/(o.value());
}
};
@ -1316,7 +1316,7 @@ warnings=1
//@A.cpp
struct other
{
bool //$value$//() {return true;}
bool /*$*/value/*$$*/() {return true;}
};
class Klass
@ -1362,7 +1362,7 @@ class Klass
{
public:
void set(bool b){}
void //$test$//()
void /*$*/test/*$$*/()
{
other o;
this->set(o.value());
@ -1394,7 +1394,7 @@ private:
filename=A.cpp
fatalerrors=1
//@A.cpp
int //$main$//(){
int /*$*/main/*$$*/(){
int i = 2;
i++;
return 0;
@ -1415,7 +1415,7 @@ filename=A.h
class Klass
{
public:
void //$to_move()$//;
void /*$*/to_move()/*$$*/;
private:
void just_private();
@ -1438,7 +1438,7 @@ filename=A.h
class Klass
{
public:
void //$to_move()$//;
void /*$*/to_move()/*$$*/;
private:
void just_private();

View file

@ -5,7 +5,7 @@ filename=A.h
//@A.h
class X {
public:
bool //$a(int = 100)$// const;
bool /*$*/a(int = 100)/*$$*/ const;
};
//=
@ -27,7 +27,7 @@ filename=A.h
//@A.h
class X {
public:
bool //$xy(int, int i)$// const;
bool /*$*/xy(int, int i)/*$$*/ const;
};
//=
@ -50,7 +50,7 @@ filename=A.h
template<class T> class A
{
public:
//$void test();$//
/*$*/void test();/*$$*/
};
//=
@ -81,7 +81,7 @@ initialWarnings=1
struct Test
{
void //$bla$//() {}
void /*$*/bla/*$$*/() {}
};
//!Test Warning when ClassName selected
@ -91,7 +91,7 @@ filename=A.h
initialWarnings=1
//@A.h
struct //$Test$//
struct /*$*/Test/*$$*/
{
void bla2();
};
@ -105,7 +105,7 @@ template<class T> class A
{
public:
A();
//$void test();$//
/*$*/void test();/*$$*/
};
template<class T> A<T>::A()
@ -140,7 +140,7 @@ class Demo
{
class SubClass
{
//$void test();$//
/*$*/void test();/*$$*/
};
};
@ -165,7 +165,7 @@ filename=A.h
class A
{
public:
//$void test();$//
/*$*/void test();/*$$*/
};
//=
@ -189,7 +189,7 @@ filename=A.h
class A
{
public:
//$void test();$//
/*$*/void test();/*$$*/
};
//=
@ -220,7 +220,7 @@ namespace NameSpace
{
public:
int test();
//$void test2();$//
/*$*/void test2();/*$$*/
};
}
@ -260,7 +260,7 @@ class A
{
public:
A();
//$virtual void foo();$//
/*$*/virtual void foo();/*$$*/
~A();
};
@ -296,7 +296,7 @@ A::~A()
//@.config
filename=A.h
//@A.h
//$void function();$//
/*$*/void function();/*$$*/
void function_with_impl();
//@A.cpp
void function_with_impl()
@ -322,7 +322,7 @@ class A
{
public:
A();
//$void foo();$//
/*$*/void foo();/*$$*/
};
#endif /*A_H_*/
@ -357,7 +357,7 @@ filename=A.h
class A
{
public:
//$void foo() const;$//
/*$*/void foo() const;/*$$*/
A();
};
@ -392,7 +392,7 @@ class A
{
public:
A();
//$int foo();$//
/*$*/int foo();/*$$*/
};
#endif /*A_H_*/
@ -428,7 +428,7 @@ class A
{
public:
A();
//$int foo(int param1, int param2);$//
/*$*/int foo(int param1, int param2);/*$$*/
};
#endif /*A_H_*/
@ -461,7 +461,7 @@ class A
{
public:
A();
//$void test();$//
/*$*/void test();/*$$*/
};
A::A()
@ -492,7 +492,7 @@ inline void A::test()
filename=A.h
//@A.h
void function_with_impl();
//$void function();$//
/*$*/void function();/*$$*/
//@A.cpp
void function_with_impl()
{
@ -518,7 +518,7 @@ namespace NameSpace
{
public:
int other_test();
//$void test();$//
/*$*/void test();/*$$*/
};
}
@ -547,7 +547,7 @@ namespace OuterSpace {
namespace NameSpace
{
int test();
//$int test2();$//
/*$*/int test2();/*$$*/
}
}
@ -578,7 +578,7 @@ namespace OuterSpace {
namespace NameSpace
{
int test();
//$int test2();$//
/*$*/int test2();/*$$*/
}
}
@ -613,7 +613,7 @@ template<class T, class U> class A
{
public:
A();
//$void test();$//
/*$*/void test();/*$$*/
};
template<class T, class U> A<T,U>::A()
@ -647,7 +647,7 @@ filename=A.h
class Class
{
public:
//$void test(int param1, int param2 = 5, int param3 = 10);$//
/*$*/void test(int param1, int param2 = 5, int param3 = 10);/*$$*/
};
@ -672,7 +672,7 @@ filename=A.h
class Class
{
public:
//$static void test();$//
/*$*/static void test();/*$$*/
};
@ -696,7 +696,7 @@ filename=A.h
class TestClass {
public:
//$int* get(char* val);$//
/*$*/int* get(char* val);/*$$*/
};
@ -721,7 +721,7 @@ filename=A.h
class Test
{
public:
//$void doNothing(void);$//
/*$*/void doNothing(void);/*$$*/
};

View file

@ -30,8 +30,8 @@ public class TestSourceFile {
private int selectionStart = -1;
private int selectionEnd = -1;
protected static final String selectionStartRegex = "//\\$"; //$NON-NLS-1$
protected static final String selectionEndRegex = "\\$//"; //$NON-NLS-1$
protected static final String selectionStartRegex = "/\\*\\$\\*/"; //$NON-NLS-1$
protected static final String selectionEndRegex = "/\\*\\$\\$\\*/"; //$NON-NLS-1$
protected static final String selectionStartLineRegex = "(.*)(" + selectionStartRegex + ")(.*)"; //$NON-NLS-1$ //$NON-NLS-2$
protected static final String selectionEndLineRegex = "(.*)("+ selectionEndRegex + ")(.*)"; //$NON-NLS-1$ //$NON-NLS-2$