Changeset View
Changeset View
Standalone View
Standalone View
duchain/builders/typebuilder.cpp
Context not available. | |||||
264 | return type; | 264 | return type; | ||
---|---|---|---|---|---|
265 | } | 265 | } | ||
266 | 266 | | |||
267 | FunctionType::Ptr TypeBuilder::openFunctionType(AstNode* node) | | |||
268 | { | | |||
269 | FunctionType::Ptr functionType = FunctionType::Ptr(new FunctionType()); | | |||
270 | | ||||
271 | openType(functionType); | | |||
272 | | ||||
273 | functionType->setReturnType(parseDocComment(node, QStringLiteral("return"))); | | |||
274 | m_gotReturnTypeFromDocComment = functionType->returnType(); | | |||
275 | updateCurrentType(); | | |||
276 | | ||||
277 | return functionType; | | |||
278 | } | | |||
279 | | ||||
280 | void TypeBuilder::visitClassDeclarationStatement(ClassDeclarationStatementAst* node) | 267 | void TypeBuilder::visitClassDeclarationStatement(ClassDeclarationStatementAst* node) | ||
281 | { | 268 | { | ||
282 | // the predeclaration builder should have set up a type already | 269 | // the predeclaration builder should have set up a type already | ||
Context not available. | |||||
309 | if (node->methodName) { | 296 | if (node->methodName) { | ||
310 | //method declaration | 297 | //method declaration | ||
311 | m_currentFunctionParams = parseDocCommentParams(node); | 298 | m_currentFunctionParams = parseDocCommentParams(node); | ||
312 | openFunctionType(node); | 299 | | ||
300 | FunctionType::Ptr functionType = FunctionType::Ptr(new FunctionType()); | ||||
301 | openType(functionType); | ||||
302 | | ||||
303 | AbstractType::Ptr phpdocReturnType = parseDocComment(node, QStringLiteral("return")); | ||||
304 | functionType->setReturnType(returnType(node->returnType, phpdocReturnType, editor(), currentContext())); | ||||
305 | m_gotReturnTypeFromDocComment = functionType->returnType(); | ||||
306 | updateCurrentType(); | ||||
307 | | ||||
313 | TypeBuilderBase::visitClassStatement(node); | 308 | TypeBuilderBase::visitClassStatement(node); | ||
314 | if (currentType<FunctionType>() && !currentType<FunctionType>()->returnType()) { | 309 | if (currentType<FunctionType>() && !currentType<FunctionType>()->returnType()) { | ||
315 | currentType<FunctionType>()->setReturnType(AbstractType::Ptr(new IntegralType(IntegralType::TypeVoid))); | 310 | currentType<FunctionType>()->setReturnType(AbstractType::Ptr(new IntegralType(IntegralType::TypeVoid))); | ||
Context not available. | |||||
380 | FunctionType::Ptr type = currentType<FunctionType>(); | 375 | FunctionType::Ptr type = currentType<FunctionType>(); | ||
381 | Q_ASSERT(type); | 376 | Q_ASSERT(type); | ||
382 | 377 | | |||
383 | type->setReturnType(parseDocComment(node, QStringLiteral("return"))); | 378 | AbstractType::Ptr phpdocReturnType = parseDocComment(node, QStringLiteral("return")); | ||
379 | type->setReturnType(returnType(node->returnType, phpdocReturnType, editor(), currentContext())); | ||||
384 | m_gotReturnTypeFromDocComment = type->returnType(); | 380 | m_gotReturnTypeFromDocComment = type->returnType(); | ||
385 | 381 | | |||
386 | updateCurrentType(); | 382 | updateCurrentType(); | ||
Context not available. | |||||
398 | FunctionType::Ptr type = FunctionType::Ptr(new FunctionType()); | 394 | FunctionType::Ptr type = FunctionType::Ptr(new FunctionType()); | ||
399 | openType(type); | 395 | openType(type); | ||
400 | 396 | | |||
401 | type->setReturnType(parseDocComment(node, QStringLiteral("return"))); | 397 | AbstractType::Ptr phpdocReturnType = parseDocComment(node, QStringLiteral("return")); | ||
398 | type->setReturnType(returnType(node->returnType, phpdocReturnType, editor(), currentContext())); | ||||
402 | m_gotReturnTypeFromDocComment = type->returnType(); | 399 | m_gotReturnTypeFromDocComment = type->returnType(); | ||
403 | 400 | | |||
404 | updateCurrentType(); | 401 | updateCurrentType(); | ||
Context not available. |