summaryrefslogtreecommitdiff
path: root/src/shared/cplusplus/Parser.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@nokia.com>2009-08-04 16:22:24 +0200
committerErik Verbruggen <erik.verbruggen@nokia.com>2009-08-04 16:22:24 +0200
commite53d23d55c7df81f47f3b8ee78ed2c5863acf083 (patch)
tree4552e25864eafba55d27e78106ca29d44e1a20fb /src/shared/cplusplus/Parser.cpp
parent86ff16e58cac3e85ffe685053b4314c565ecdfb1 (diff)
downloadqt-creator-e53d23d55c7df81f47f3b8ee78ed2c5863acf083.tar.gz
Merged ObjCMethodDefinitionAST into ObjCMethodDeclarationAST.
Diffstat (limited to 'src/shared/cplusplus/Parser.cpp')
-rw-r--r--src/shared/cplusplus/Parser.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/shared/cplusplus/Parser.cpp b/src/shared/cplusplus/Parser.cpp
index 70bc64ae3d..c4eb17ab64 100644
--- a/src/shared/cplusplus/Parser.cpp
+++ b/src/shared/cplusplus/Parser.cpp
@@ -4321,20 +4321,18 @@ bool Parser::parseObjCMethodDefinition(DeclarationAST *&node)
if (! parseObjCMethodPrototype(method_prototype))
return false;
+ ObjCMethodDeclarationAST *ast = new (_pool) ObjCMethodDeclarationAST;
+ ast->method_prototype = method_prototype;
+
if (LA() == T_SEMICOLON) {
// method declaration:
- ObjCMethodDeclarationAST *ast = new (_pool) ObjCMethodDeclarationAST;
- ast->method_prototype = method_prototype;
ast->semicolon_token = consumeToken();
- node = ast;
} else {
// method definition:
- ObjCMethodDefinitionAST *ast = new (_pool) ObjCMethodDefinitionAST;
- ast->method_prototype = method_prototype;
parseFunctionBody(ast->function_body);
- node = ast;
}
+ node = ast;
return true;
}
@@ -4567,10 +4565,14 @@ bool Parser::parseObjCMethodPrototype(ObjCMethodPrototypeAST *&node)
DeclarationAST *parameter_declaration = 0;
parseParameterDeclaration(parameter_declaration);
}
+
+ node = ast;
} else if (lookAtObjCSelector()) {
ObjCSelectorWithoutArgumentsAST *sel = new (_pool) ObjCSelectorWithoutArgumentsAST;
parseObjCSelector(sel->name_token);
ast->selector = sel;
+
+ node = ast;
} else {
_translationUnit->error(cursor(), "expected a selector");
}
@@ -4579,7 +4581,6 @@ bool Parser::parseObjCMethodPrototype(ObjCMethodPrototypeAST *&node)
while (parseAttributeSpecifier(*attr))
attr = &(*attr)->next;
- node = ast;
return true;
}