add something a la CodeModelItem::visibility ?

Milian Wolff mail at milianw.de
Sun Sep 20 22:45:21 UTC 2009


David Nolden, 21.09.2009:
> Am Montag 21 September 2009 00:07:06 schrieb Milian Wolff:
> > In regard to your last email, I can't use this then.
> >
> > Could this speedup be "fixed"? I mean this makes it really impossible for
> >  me add anything to setInSymbolTable(false) !
> 
> When you do "context->setInSymbolTable(false)", you get the same effect as
>  if you did in on the declarations individually, and
>  findLocalDeclarations(..) will work perfectly. Why is that a problem? It
>  usually depends on the context whether something is visible globally or
>  not, not on the item itself.
> 
> For example, you can _always_ call "setInSymbolTable(false)" on the
>  internal context of a function. At least I've never seen in any language
>  something like "someFunction.localVariable = 3".

JavaScript could potentially do that. But I'm no JavaScript guru. But this is 
possible:

function foo {
alert(foo.var);
}
foo.var = 1;
foo();

But for PHP I think this really is not required. I'll just have to make sure 
that each function (not method), constant etc. gets the top-context as parent. 
then I can use the visibility flag on the contexts. I'll try that out, thanks.

> > And it makes no sense to me that you would only get decs in the symbol
> >  table when you explicitly request the child-items of a context.
> >
> > In my impression, any findLocalDeclaration or the localDeclarations()
> >  method should give me the declarations of the current context, no matter
> >  whether they are in the symbol table or not.
> 
> Of course. The problem is only if "context->inSymbolTable() != context-
> 
> >declarations()[x]->inSymbolTable()".
> 
> So in order to make this consistent, maybe the best fix is just removing
> "Declaration::setInSymbolTable", so declarations always inherit the
>  visibility of the context.
> 
> The other fix would be making sure that the local-search speedup through
>  the symbol-table is not used if the context contains at least one
>  declaration that has "inSymbolTable() == false", but that's annoying and
>  maybe even slow to do.

Indeed, remove the stuff from declarations. That is only confusing (as you see 
with me).

-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20090921/44463900/attachment.sig>


More information about the KDevelop-devel mailing list