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

List:       kde-commits
Subject:    kdevelop/parts/cppsupport
From:       Roberto Raggi <roberto () kdevelop ! org>
Date:       2003-09-01 14:09:13
[Download RAW message or body]

CVS commit by raggi: 

create a declaration for ::main() function definition


  M +5 -4      store_walker.cpp   1.54


--- kdevelop/parts/cppsupport/store_walker.cpp  #1.53:1.54
@@ -206,5 +206,5 @@ void StoreWalker::parseFunctionDefinitio
         method->setSlot( true );
 
-    if( m_currentClass.top() ){
+    if( m_currentClass.top() || (method->name() == "main" && scope.isEmpty()) ){
         method->setConstant( d->constant() != 0 );
         method->setAccess( m_currentAccess );
@@ -212,5 +212,8 @@ void StoreWalker::parseFunctionDefinitio
         method->setVirtual( isVirtual );
 
+        if( m_currentClass.top() )
         m_currentClass.top()->addFunction( model_cast<FunctionDom>(method) );
+        else 
+            m_file->addFunction( model_cast<FunctionDom>(method) );
     }
 
@@ -432,6 +435,4 @@ void StoreWalker::parseAccessDeclaration
 NamespaceDom StoreWalker::findOrInsertNamespace( NamespaceAST* ast, const QString & name )
 {
-    kdDebug(9007) << "-----------------> findOrInsert" << name << " found!!" << endl;
-
     if( m_currentNamespace.top() && m_currentNamespace.top()->hasNamespace(name) )
         return m_currentNamespace.top()->namespaceByName( name );


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

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