Changeset View
Changeset View
Standalone View
Standalone View
duchain/builders/declarationbuilder.cpp
Context not available. | |||||
1625 | closeDeclaration(); | 1625 | closeDeclaration(); | ||
---|---|---|---|---|---|
1626 | } | 1626 | } | ||
1627 | 1627 | | |||
1628 | void DeclarationBuilder::visitUseStatement(UseStatementAst* node) | ||||
1629 | { | ||||
1630 | if ( node->useFunction != -1 ) | ||||
1631 | { | ||||
1632 | m_useNamespaceType = FunctionDeclarationType; | ||||
1633 | } | ||||
1634 | else if ( node->useConst != -1 ) | ||||
1635 | { | ||||
1636 | m_useNamespaceType = ConstantDeclarationType; | ||||
1637 | } | ||||
1638 | else | ||||
1639 | { | ||||
1640 | m_useNamespaceType = ClassDeclarationType; | ||||
1641 | } | ||||
1642 | DeclarationBuilderBase::visitUseStatement(node); | ||||
1643 | } | ||||
1644 | | ||||
1628 | void DeclarationBuilder::visitUseNamespace(UseNamespaceAst* node) | 1645 | void DeclarationBuilder::visitUseNamespace(UseNamespaceAst* node) | ||
1629 | { | 1646 | { | ||
1630 | DUChainWriteLocker lock; | 1647 | DUChainWriteLocker lock; | ||
Context not available. | |||||
1642 | ///TODO: case insensitive! | 1659 | ///TODO: case insensitive! | ||
1643 | QualifiedIdentifier qid = identifierForNamespace(node->identifier, m_editor); | 1660 | QualifiedIdentifier qid = identifierForNamespace(node->identifier, m_editor); | ||
1644 | 1661 | | |||
1645 | DeclarationPointer dec = findDeclarationImport(ClassDeclarationType, qid); | 1662 | DeclarationPointer dec = findDeclarationImport(m_useNamespaceType, qid); | ||
1646 | 1663 | | |||
1647 | if (!dec && !qid.explicitlyGlobal()) { | 1664 | if (!dec && !qid.explicitlyGlobal()) { | ||
1648 | QualifiedIdentifier globalQid = qid; | 1665 | QualifiedIdentifier globalQid = qid; | ||
1649 | globalQid.setExplicitlyGlobal(true); | 1666 | globalQid.setExplicitlyGlobal(true); | ||
1650 | dec = findDeclarationImport(ClassDeclarationType, globalQid); | 1667 | dec = findDeclarationImport(m_useNamespaceType, globalQid); | ||
1651 | } | 1668 | } | ||
1652 | 1669 | | |||
1653 | if (dec) | 1670 | if (dec) | ||
1654 | { | 1671 | { | ||
1655 | // Check for a name conflict | 1672 | // Check for a name conflict | ||
1656 | DeclarationPointer dec2 = findDeclarationImport(ClassDeclarationType, id.second); | 1673 | DeclarationPointer dec2 = findDeclarationImport(m_useNamespaceType, id.second); | ||
1657 | 1674 | | |||
1658 | if (dec2 && dec2->context()->scopeIdentifier() == currentContext()->scopeIdentifier() && | 1675 | if (dec2 && dec2->context()->scopeIdentifier() == currentContext()->scopeIdentifier() && | ||
1659 | dec2->context()->topContext() == currentContext()->topContext() && | 1676 | dec2->context()->topContext() == currentContext()->topContext() && | ||
Context not available. |