From kde-commits Thu Jul 12 08:04:44 2012 From: Alexander Dymo Date: Thu, 12 Jul 2012 08:04:44 +0000 To: kde-commits Subject: [kdev-ruby/gsoc] duchain/builders: Do nothing when parsing assignments to array values, for example Message-Id: <20120712080444.2F61AA6094 () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=134208053025789 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 parsi= ng "x[y] =3D z" do not try to declare variable "x[y]". "x" should be already declared and s= et 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/dec= larationbuilder.cpp index 24a9b46..6526c9a 100644 --- a/duchain/builders/declarationbuilder.cpp +++ b/duchain/builders/declarationbuilder.cpp @@ -384,6 +384,12 @@ void DeclarationBuilder::visitAssignmentStatement(Ruby= Ast *node) QualifiedIdentifier id =3D getIdentifier(aux); declareVariable(currentContext(), newType.cast(), id, aux); } + } else if (n->kind =3D=3D token_array_value) { + // assignment to array value, for example: + // x[y] =3D 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());