forked from qt-creator/qt-creator
Clang: Filter scope operators
Scope operators are not really user defined. Change-Id: I1ab08dc3db7c39b98da02b6ef10bf78b75a6856d Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
committed by
Nikolai Kosjar
parent
bd10e9b020
commit
2e499b73d6
@@ -241,11 +241,23 @@ HighlightingType literalKind(const Cursor &cursor)
|
||||
Q_UNREACHABLE();
|
||||
}
|
||||
|
||||
bool hasOperatorName(const char *operatorString)
|
||||
{
|
||||
return std::strncmp(operatorString, "operator", 8) == 0;
|
||||
}
|
||||
|
||||
HighlightingType operatorKind(const Cursor &cursor)
|
||||
{
|
||||
if (hasOperatorName(cursor.spelling().cString()))
|
||||
return HighlightingType::Operator;
|
||||
else
|
||||
return HighlightingType::Invalid;
|
||||
}
|
||||
|
||||
HighlightingType punctationKind(const Cursor &cursor)
|
||||
{
|
||||
switch (cursor.kind()) {
|
||||
case CXCursor_DeclRefExpr: return HighlightingType::Operator;
|
||||
case CXCursor_DeclRefExpr: return operatorKind(cursor);
|
||||
default: return HighlightingType::Invalid;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user