forked from qt-creator/qt-creator
		
	Data added: - return type spelling for functions - parent spelling - access specifier for class fields and methods - storage class New highlighting types are added, therefore types are now categorized by class, struct, etc. Change-Id: I1739b94a6f777045fde655060d8b9a12b6e0889b Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
		
			
				
	
	
		
			138 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			138 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
#include "cursor.h"
 | 
						|
 | 
						|
void function(int x)
 | 
						|
{
 | 
						|
 | 
						|
}
 | 
						|
 | 
						|
namespace Namespace
 | 
						|
{
 | 
						|
SuperClass::SuperClass(int x) noexcept
 | 
						|
  : y(x)
 | 
						|
{
 | 
						|
    int LocalVariable;
 | 
						|
}
 | 
						|
 | 
						|
int SuperClass::Method()
 | 
						|
{
 | 
						|
    Method();
 | 
						|
    AbstractVirtualMethod(y);
 | 
						|
    int LocalVariable;
 | 
						|
    return y;
 | 
						|
}
 | 
						|
 | 
						|
int SuperClass::VirtualMethod(int z)
 | 
						|
{
 | 
						|
    AbstractVirtualMethod(z);
 | 
						|
 | 
						|
    return y;
 | 
						|
}
 | 
						|
 | 
						|
bool SuperClass::ConstMethod() const
 | 
						|
{
 | 
						|
    return y;
 | 
						|
}
 | 
						|
 | 
						|
void SuperClass::StaticMethod()
 | 
						|
{
 | 
						|
    using longint = long long int;
 | 
						|
    using lint = longint;
 | 
						|
 | 
						|
    lint foo;
 | 
						|
 | 
						|
    foo = 30;
 | 
						|
 | 
						|
    const lint bar = 20;
 | 
						|
}
 | 
						|
}
 | 
						|
 | 
						|
template <class T>
 | 
						|
void TemplateFunction(T LocalVariableParameter)
 | 
						|
{
 | 
						|
    T LocalVariable;
 | 
						|
}
 | 
						|
 | 
						|
Namespace::SuperClass::operator int() const
 | 
						|
{
 | 
						|
    int LocalVariable;
 | 
						|
}
 | 
						|
 | 
						|
int Namespace::SuperClass::operator ++() const
 | 
						|
{
 | 
						|
    int LocalVariable;
 | 
						|
 | 
						|
    return LocalVariable;
 | 
						|
}
 | 
						|
 | 
						|
Namespace::SuperClass::~SuperClass()
 | 
						|
{
 | 
						|
    int LocalVariable;
 | 
						|
}
 | 
						|
 | 
						|
void Struct::FinalVirtualMethod()
 | 
						|
{
 | 
						|
 | 
						|
}
 | 
						|
 | 
						|
void f1(Struct *FindFunctionCaller)
 | 
						|
{
 | 
						|
    FindFunctionCaller->FinalVirtualMethod();
 | 
						|
}
 | 
						|
 | 
						|
void f2(){
 | 
						|
    Struct *s = new Struct;
 | 
						|
 | 
						|
    f1(s);
 | 
						|
}
 | 
						|
 | 
						|
void f3()
 | 
						|
{
 | 
						|
    auto FindFunctionCaller = Struct();
 | 
						|
 | 
						|
    FindFunctionCaller.FinalVirtualMethod();
 | 
						|
}
 | 
						|
 | 
						|
 | 
						|
void f4()
 | 
						|
{
 | 
						|
    Struct s;
 | 
						|
 | 
						|
    auto *sPointer = &s;
 | 
						|
    auto sValue = s;
 | 
						|
}
 | 
						|
 | 
						|
void NonFinalStruct::function()
 | 
						|
{
 | 
						|
    FinalVirtualMethod();
 | 
						|
}
 | 
						|
 | 
						|
void OutputFunction(int &out, int in = 1, const int &in2=2, int *out2=nullptr);
 | 
						|
void InputFunction(const int &value);
 | 
						|
 | 
						|
void f5()
 | 
						|
{
 | 
						|
    int OutputValue;
 | 
						|
    int InputValue = 20;
 | 
						|
 | 
						|
    OutputFunction(OutputValue);
 | 
						|
    InputFunction(InputValue);
 | 
						|
}
 | 
						|
 | 
						|
void ArgumentCountZero();
 | 
						|
void ArgumentCountTwo(int one, const int &two);
 | 
						|
void IntegerValue(int);
 | 
						|
void LValueReference(int &);
 | 
						|
void ConstLValueReference(const int &);
 | 
						|
void PointerToConst(const int *);
 | 
						|
void Pointer(int *);
 | 
						|
void ConstantPointer(int *const);
 | 
						|
void ConstIntegerValue(const int);
 | 
						|
 | 
						|
void NonFinalStruct::ProtectedMethodAccessSpecifier() {}
 | 
						|
 | 
						|
extern int ExternVarStorageClass;
 | 
						|
 | 
						|
static void StaticMethodStorageClass() {}
 | 
						|
 | 
						|
template<class T> const T &InvalidStorageClass(const T &type) { return type; }
 |