Question about AbstractUseBuilder::newUse

Cédric Pasteur cedric.pasteur at polytechnique.org
Fri Mar 13 13:02:14 UTC 2009


Le jeudi 12 mars 2009 23:03:43 Hamish Rodda, vous avez écrit :
> Hi,
>
> On Friday 13 March 2009 02:00:06 Cédric Pasteur wrote:
> > Hi,
> > I am writing a language support plugin for OCaml (I'll soon commit it to
> > playground). In Caml, every file automatically corresponds to a module
> > named like the file, so I decided to create a namespace context in the
> > main ast node.
>
> For Caml, are the identifiers in each file truly namespaced? ie., do you
> refer to other file's identifiers using the qualified name including the
> file name?
Yes
>
> > The problem is that when I add this context , use building fails inside
> > this context. It works correctly in child contexts (eg functions) but a
> > call to new use in the namespace context doesn't have any effect.
> > Everything works if I don't create this top namespace context.
> >
> > What can be the reason for a newUse() call to fail ? What am I doing
> > wrong?
>
> Uses were reworked by David and I haven't thoroughly gone through the code
> for them, but if the namespace means that the declaration(s) cannot be
> found, that may be the problem (at a guess).  If you search for the
> declaration, with and without the namespace context, at the place where you
> call newUse, do you get a declaration without the namespace context and
> none with it?
Actually, I call newUse(node, decl) with a correct declaration (whether or not 
there is a namespace context) but it seems like nothing happens. What is 
really weird is that when I create a regular namespace context, use building 
inside this context works just fine.

Cédric




More information about the KDevelop-devel mailing list