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

List:       kde-commits
Subject:    [kdev-ruby] duchain/builders: This time correctly create context for the function body, even if it's
From:       Alexander Dymo <adymo () kdevelop ! org>
Date:       2012-10-26 23:07:54
Message-ID: 20121026230754.D4ECDA6078 () git ! kde ! org
[Download RAW message or body]

Git commit 0b5562b8dcfd25a28c38b0aac89155d707927b07 by Alexander Dymo.
Committed on 27/10/2012 at 01:07.
Pushed by dymo into branch 'master'.

This time correctly create context for the function body, even if it's empty.
Make sure we add function parameters to the context even if it's empty.

M  +9    -10   duchain/builders/contextbuilder.cpp

http://commits.kde.org/kdev-ruby/0b5562b8dcfd25a28c38b0aac89155d707927b07

diff --git a/duchain/builders/contextbuilder.cpp b/duchain/builders/contextbuilder.cpp
index b2073c6..e0ba3c1 100644
--- a/duchain/builders/contextbuilder.cpp
+++ b/duchain/builders/contextbuilder.cpp
@@ -195,17 +195,16 @@ void ContextBuilder::visitMethodStatement(RubyAst *node)
     }
 
     node->tree = aux->l;
-    if (node->tree && is_valid(node->tree)) {
-        DUContext *body = openContext(node, DUContext::Other, &name);
-        if (compilingContexts()) {
-            DUChainWriteLocker wlock(DUChain::lock());
-            if (params)
-              body->addImportedParentContext(params);
-            body->setInSymbolTable(false);
-        }
-        visitBody(node);
-        closeContext();
+    DUContext *body = openContext(node, DUContext::Other, &name);
+    if (compilingContexts()) {
+        DUChainWriteLocker wlock(DUChain::lock());
+        if (params)
+            body->addImportedParentContext(params);
+        body->setInSymbolTable(false);
     }
+    if (node->tree && is_valid(node->tree))
+        visitBody(node);
+    closeContext();
     node->tree = aux;
 }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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