diff options
| author | Erik Verbruggen <[email protected]> | 2009-07-31 16:03:48 +0200 |
|---|---|---|
| committer | Erik Verbruggen <[email protected]> | 2009-07-31 16:03:48 +0200 |
| commit | 4a0da2c6f2663d9469bfd929fa682b6df7d42ab7 (patch) | |
| tree | d8fb1fbbeacaadad06024ecd5ce8e84c8f30d547 /src/libs/cplusplus | |
| parent | b713f1772a4de8330bcdd96a00b9cf103541e008 (diff) | |
Added Semantic checks for ObjC methods.
Diffstat (limited to 'src/libs/cplusplus')
| -rw-r--r-- | src/libs/cplusplus/NamePrettyPrinter.cpp | 17 | ||||
| -rw-r--r-- | src/libs/cplusplus/NamePrettyPrinter.h | 1 | ||||
| -rw-r--r-- | src/libs/cplusplus/OverviewModel.cpp | 6 |
3 files changed, 24 insertions, 0 deletions
diff --git a/src/libs/cplusplus/NamePrettyPrinter.cpp b/src/libs/cplusplus/NamePrettyPrinter.cpp index 75aa582cded..788c418c09a 100644 --- a/src/libs/cplusplus/NamePrettyPrinter.cpp +++ b/src/libs/cplusplus/NamePrettyPrinter.cpp @@ -253,3 +253,20 @@ void NamePrettyPrinter::visit(QualifiedNameId *name) _name += operator()(name->nameAt(index)); } } + +void NamePrettyPrinter::visit(SelectorNameId *name) +{ + for (unsigned i = 0; i < name->nameCount(); ++i) { + Name *n = name->nameAt(i); + if (!n) + continue; + + Identifier *id = n->identifier(); + if (id) { + _name += QString::fromLatin1(id->chars(), id->size()); + + if (name->hasArguments() || name->nameCount() > 1) + _name += ':'; + } + } +} diff --git a/src/libs/cplusplus/NamePrettyPrinter.h b/src/libs/cplusplus/NamePrettyPrinter.h index 2e0ef2c9b1c..6704099009c 100644 --- a/src/libs/cplusplus/NamePrettyPrinter.h +++ b/src/libs/cplusplus/NamePrettyPrinter.h @@ -55,6 +55,7 @@ protected: virtual void visit(OperatorNameId *name); virtual void visit(ConversionNameId *name); virtual void visit(QualifiedNameId *name); + virtual void visit(SelectorNameId *name); private: const Overview *_overview; diff --git a/src/libs/cplusplus/OverviewModel.cpp b/src/libs/cplusplus/OverviewModel.cpp index 008fb97abe9..ed119824af9 100644 --- a/src/libs/cplusplus/OverviewModel.cpp +++ b/src/libs/cplusplus/OverviewModel.cpp @@ -164,6 +164,12 @@ QVariant OverviewModel::data(const QModelIndex &index, int role) const QString name = _overview.prettyName(symbol->name()); if (name.isEmpty()) name = QLatin1String("anonymous"); + if (symbol->isObjCForwardClassDeclaration()) + name = QLatin1String("@class ") + name; + if (symbol->isObjCForwardProtocolDeclaration() || symbol->isObjCProtocol()) + name = QLatin1String("@protocol ") + name; + if (symbol->isObjCClass()) + name = QLatin1String("@interface ") + name; if (! symbol->isScopedSymbol() || symbol->isFunction()) { QString type = _overview.prettyType(symbol->type()); if (! type.isEmpty()) { |
