forked from qt-creator/qt-creator
Simplified ObjC selectors in the AST.
This commit is contained in:
@@ -463,29 +463,26 @@ bool FindUsages::visit(SimpleDeclarationAST *ast)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FindUsages::visit(ObjCSelectorWithoutArgumentsAST *ast)
|
||||
bool FindUsages::visit(ObjCSelectorAST *ast)
|
||||
{
|
||||
const Identifier *id = identifier(ast->name_token);
|
||||
#if 1
|
||||
const Identifier *id = ast->name->identifier();
|
||||
if (id == _id) {
|
||||
LookupContext context = currentContext(ast);
|
||||
const QList<Symbol *> candidates = context.resolve(ast->selector_name);
|
||||
reportResult(ast->name_token, candidates);
|
||||
const QList<Symbol *> candidates = context.resolve(ast->name);
|
||||
reportResult(ast->firstToken(), candidates);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FindUsages::visit(ObjCSelectorWithArgumentsAST *ast)
|
||||
{
|
||||
#else
|
||||
for (ObjCSelectorArgumentListAST *iter = ast->selector_argument_list; iter;
|
||||
iter = iter->next) {
|
||||
const Identifier *id = identifier(iter->value->name_token);
|
||||
if (id == _id) {
|
||||
LookupContext context = currentContext(iter->value);
|
||||
const QList<Symbol *> candidates = context.resolve(ast->selector_name);
|
||||
const QList<Symbol *> candidates = context.resolve(ast->name);
|
||||
reportResult(iter->value->name_token, candidates);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -99,8 +99,7 @@ protected:
|
||||
virtual bool visit(ExpressionOrDeclarationStatementAST *ast);
|
||||
virtual bool visit(FunctionDeclaratorAST *ast);
|
||||
virtual bool visit(SimpleDeclarationAST *);
|
||||
virtual bool visit(ObjCSelectorWithoutArgumentsAST *ast);
|
||||
virtual bool visit(ObjCSelectorWithArgumentsAST *ast);
|
||||
virtual bool visit(ObjCSelectorAST *ast);
|
||||
|
||||
private:
|
||||
const Identifier *_id;
|
||||
|
||||
@@ -803,12 +803,12 @@ bool ResolveExpression::visit(ObjCMessageExpressionAST *ast)
|
||||
}
|
||||
}
|
||||
|
||||
if (klassName&&ast->selector && ast->selector->selector_name) {
|
||||
if (klassName&&ast->selector && ast->selector->name) {
|
||||
ResolveObjCClass resolveObjCClass;
|
||||
QList<Symbol *> resolvedSymbols = resolveObjCClass(klassName, result, _context);
|
||||
foreach (Symbol *resolvedSymbol, resolvedSymbols)
|
||||
if (ObjCClass *klass = resolvedSymbol->asObjCClass())
|
||||
_results.append(resolveMember(ast->selector->selector_name, klass));
|
||||
_results.append(resolveMember(ast->selector->name, klass));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user