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

List:       kde-commits
Subject:    [kdev-ruby/gsoc] duchain/builders: Do nothing when parsing assignments to array values, for example
From:       Alexander Dymo <adymo () kdevelop ! org>
Date:       2012-07-12 8:04:44
Message-ID: 20120712080444.2F61AA6094 () git ! kde ! org
[Download RAW message or body]

Git commit c3fcace330b2052f392a77ebf5f9abcb6d85b318 by Alexander Dymo.
Committed on 12/07/2012 at 10:02.
Pushed by dymo into branch 'gsoc'.

Do nothing when parsing assignments to array values, for example when parsing "x[y] = \
z" do not try to declare variable "x[y]". "x" should be already declared and set to \
                Array type at this point.
Miquel: please review this. I'm not sure what else has to be done here

CCMAIL: mikisabate@gmail.com

M  +6    -0    duchain/builders/declarationbuilder.cpp

http://commits.kde.org/kdev-ruby/c3fcace330b2052f392a77ebf5f9abcb6d85b318

diff --git a/duchain/builders/declarationbuilder.cpp \
b/duchain/builders/declarationbuilder.cpp index 24a9b46..6526c9a 100644
--- a/duchain/builders/declarationbuilder.cpp
+++ b/duchain/builders/declarationbuilder.cpp
@@ -384,6 +384,12 @@ void DeclarationBuilder::visitAssignmentStatement(RubyAst *node)
                 QualifiedIdentifier id = getIdentifier(aux);
                 declareVariable(currentContext(), newType.cast<AbstractType>(), id, \
aux);  }
+        } else if (n->kind == token_array_value) {
+            // assignment to array value, for example:
+            // x[y] = z
+            // "x" should already be defined by this point and have Array type
+            // there's nothing to be done with "y"
+            // TODO: adymo: what else shall we do here, if anything?
         } else if (i < rsize) {
             if (alias.at(i)) {
                 DUChainWriteLocker wlock(DUChain::lock());


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

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