[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: =?utf-8?q?=5Bkdev-python=5D_/=3A_If_parsing_a_document_for_the_f?=
From: Sven Brauch <svenbrauch () googlemail ! com>
Date: 2011-03-31 20:08:55
Message-ID: 20110331200855.4301BA609B () git ! kde ! org
[Download RAW message or body]
Git commit afd0aa23eccf83129bcb015fff817ff2e7094f60 by Sven Brauch.
Committed on 31/03/2011 at 22:09.
Pushed by brauch into branch 'master'.
If parsing a document for the first time, parse it twice.
This is not very nice, but fixes a problem with highlighting colors...
it'll be needed anyway for type support, so it doesn't really matter.
However, it does not yet have the expected effect on type building.
M +1 -0 duchain/contextbuilder.cpp
M +6 -0 parser/astdefaultvisitor.cpp
http://commits.kde.org/kdev-python/afd0aa23eccf83129bcb015fff817ff2e7094f60
diff --git a/duchain/contextbuilder.cpp b/duchain/contextbuilder.cpp
index 857b711..87cd83b 100644
--- a/duchain/contextbuilder.cpp
+++ b/duchain/contextbuilder.cpp
@@ -73,6 +73,7 @@ ReferencedTopDUContext ContextBuilder::build(const IndexedString& \
url, Ast* node updateContext->clearProblems();
} else {
kDebug() << "compiling" << url.str();
+ DUChain::self()->updateContextForUrl(currentlyParsedDocument(), \
TopDUContext::AllDeclarationsContextsAndUses, 0, 5); }
return ContextBuilderBase::build(url, node, updateContext);
diff --git a/parser/astdefaultvisitor.cpp b/parser/astdefaultvisitor.cpp
index 97bba97..d606964 100644
--- a/parser/astdefaultvisitor.cpp
+++ b/parser/astdefaultvisitor.cpp
@@ -367,7 +367,13 @@ void AstDefaultVisitor::visitCall(CallAst* node)
void AstDefaultVisitor::visitFunctionDefinition(FunctionDefinitionAst* node)
{
+ foreach (NameAst* decorator, node->decorators) {
+ visitNode(decorator);
+ }
visitNode(node->arguments);
+ foreach (Ast* stmt, node->body) {
+ visitNode(stmt);
+ }
}
void AstDefaultVisitor::visitAttribute(AttributeAst* node)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic