~ubuntu-branches/ubuntu/utopic/kdevelop-php/utopic

« back to all changes in this revision

Viewing changes to duchain/predeclarationbuilder.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2010-01-17 17:10:22 UTC
  • Revision ID: james.westby@ubuntu.com-20100117171022-nx770ylotvqxwlmc
Tags: 1.0.0~beta2-1
Initial release (Closes: #565680)

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include <ktexteditor/smartinterface.h>
27
27
 
28
28
#include <language/duchain/stringhelpers.h>
29
 
#include <language/duchain/aliasdeclaration.h>
30
29
#include <language/duchain/types/functiontype.h>
31
30
 
32
31
#include <klocalizedstring.h>
85
84
        m_types->insert(node->className->string, dec);
86
85
    }
87
86
 
88
 
    // only visit the body to look for other function declarations inside the methods
89
 
    visitNode(node->body);
 
87
    PreDeclarationBuilderBase::visitClassDeclarationStatement(node);
90
88
 
91
89
    closeDeclaration();
92
90
}
112
110
        m_types->insert(node->interfaceName->string, dec);
113
111
    }
114
112
 
115
 
    // don't evaluate the body or extends of interfaces in PreDeclarationBuilder
 
113
    PreDeclarationBuilderBase::visitInterfaceDeclarationStatement(node);
116
114
 
117
115
    closeDeclaration();
118
116
}
119
117
 
120
 
void PreDeclarationBuilder::visitClassStatement(ClassStatementAst* node)
121
 
{
122
 
    // we are only looking for function declarations inside methods
123
 
    if (node->methodBody) {
124
 
        visitNode(node->methodBody);
125
 
    } else {
126
 
        PreDeclarationBuilderBase::visitClassStatement(node);
127
 
    }
128
 
}
129
 
 
130
118
void PreDeclarationBuilder::visitClassVariable(ClassVariableAst* node)
131
119
{
132
120
    m_upcomingClassVariables->append(identifierForNode(node->variable));
149
137
 
150
138
        m_functions->insert(node->functionName->string, dec);
151
139
    }
152
 
    // only visit the body to look for other function declarations
153
 
    visitNode(node->functionBody);
 
140
 
 
141
    PreDeclarationBuilderBase::visitFunctionDeclarationStatement(node);
154
142
 
155
143
    closeDeclaration();
156
144
}
157
145
 
 
146
void PreDeclarationBuilder::closeContext()
 
147
{
 
148
    // we don't want to cleanup here, see DeclarationBuilder::closeContext()
 
149
    setCompilingContexts(false);
 
150
    PreDeclarationBuilderBase::closeContext();
 
151
    setCompilingContexts(true);
 
152
}
 
153
 
158
154
}