[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdevelop/projectmanagers/cmake/parser
From:       Aleix Pol Gonzalez <aleixpol () gmail ! com>
Date:       2009-03-01 2:33:14
Message-ID: 1235874794.857189.17052.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 933488 by apol:

More fixes on the DUChain cmake support.


 M  +12 -8     cmakeprojectvisitor.cpp  
 M  +2 -2      cmakeprojectvisitor.h  


--- trunk/KDE/kdevelop/projectmanagers/cmake/parser/cmakeprojectvisitor.cpp \
#933487:933488 @@ -460,7 +460,7 @@
         if ( !include.isEmpty() )
         {
             kDebug(9042) << "including:" << path;
-            walk(include, 0);
+            walk(include, 0, true);
         }
         else
         {
@@ -551,7 +551,7 @@
         {
             path=KUrl(path).pathOrUrl();
             kDebug(9042) << "================== Found" << path << "===============";
-            walk(package, 0);
+            walk(package, 0, true);
         }
         else
         {
@@ -574,11 +574,16 @@
     return 1;
 }
 
-KDevelop::ReferencedTopDUContext CMakeProjectVisitor::createContext(const KUrl& \
path, ReferencedTopDUContext aux, int endl ,int endc) \
+KDevelop::ReferencedTopDUContext CMakeProjectVisitor::createContext(const KUrl& \
path, ReferencedTopDUContext aux, +                                                   \
int endl ,int endc, bool isClean)  {
     DUChainWriteLocker lock(DUChain::lock());
     KDevelop::ReferencedTopDUContext topctx=DUChain::self()->chainForDocument(path);
     
+    if(!isClean && topctx) {
+        return topctx;
+    }
+    
     if(topctx)
     {
         topctx->deleteLocalDeclarations();
@@ -846,7 +851,7 @@
 {
     if(def.arguments.isEmpty() || end.arguments.isEmpty())
         return;
-    QString id=def.arguments.first().value;
+    QString id=def.arguments.first().value.toLower();
     
     DUChainWriteLocker lock(DUChain::lock());
     QList<Declaration*> decls=m_topctx->findDeclarations(Identifier(id));
@@ -951,7 +956,7 @@
         {
             {
                 DUChainWriteLocker lock(DUChain::lock());
-                QList<Declaration*> \
decls=m_topctx->findDeclarations(Identifier(call->name())); +                \
QList<Declaration*> decls=m_topctx->findDeclarations(Identifier(call->name().toLower()));
  
                 if(!decls.isEmpty())
                 {
@@ -1575,7 +1580,6 @@
                     {
                         rx.indexIn(in);
                         QStringList info = rx.capturedTexts();
-                        int idx=0, count=0, last=0;
                         
                         QString tmp = sast->replace();
                         for(int i = 1; i < info.count(); i++)
@@ -1850,7 +1854,7 @@
     return No;
 }
 
-int CMakeProjectVisitor::walk(const CMakeFileContent & fc, int line)
+int CMakeProjectVisitor::walk(const CMakeFileContent & fc, int line, bool isClean)
 {
     ReferencedTopDUContext aux=m_topctx;
     KUrl url(fc[0].filePath);
@@ -1858,7 +1862,7 @@
     if(!m_topctx || m_topctx->url().toUrl()!=url)
     {
         kDebug(9042) << "Creating a context for" << url;
-        m_topctx=createContext(url, aux ? aux : m_parentCtx, fc.last().endLine-1, \
fc.last().endColumn-1); +        m_topctx=createContext(url, aux ? aux : m_parentCtx, \
fc.last().endLine-1, fc.last().endColumn-1, isClean);  if(!aux)
             aux=m_topctx;
     }
--- trunk/KDE/kdevelop/projectmanagers/cmake/parser/cmakeprojectvisitor.h \
#933487:933488 @@ -111,7 +111,7 @@
         CMakeFunctionDesc folderDeclarationDescriptor(const QString& name) const { \
                return m_folderDesc[name]; }
         CMakeFunctionDesc targetDeclarationDescriptor(const QString& name) const { \
return m_targetDesc[name]; }  
-        int walk(const CMakeFileContent& fc, int line);
+        int walk(const CMakeFileContent& fc, int line, bool isClean=false);
         
 //         static VariableType hasVariable(const QString &name);
         static QStringList envVarDirectories(const QString &varName);
@@ -156,7 +156,7 @@
         
     private:
         static KDevelop::ReferencedTopDUContext
-            createContext(const KUrl& path, KDevelop::ReferencedTopDUContext aux, \
int endl ,int endc); +            createContext(const KUrl& path, \
KDevelop::ReferencedTopDUContext aux, int endl ,int endc, bool isClean);  
         void macroDeclaration(const CMakeFunctionDesc& def, const CMakeFunctionDesc& \
end, const QStringList& args);  CMakeFunctionDesc resolveVariables(const \
CMakeFunctionDesc &exp);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic