[nem-en] Integration issues

Kamil Skalski kamil.skalski at gmail.com
Thu Aug 31 22:59:59 CEST 2006


On 8/31/06, Igor Tkachev <it at rsdn.ru> wrote:
> Hello Kamil,
>
> > Maybe we should create a subtype of Typer, like  CompletionTyper,
> > which could do the "different" stuff for various parts of
> > implementation. Manager could have a "factory" method to create Typer
> > / CompletionTyper depending on the actual engine being used.
> > I guess completion runs only on Typer (or maybe also Typer2), so for
> > the pure completion purpose this will be ok.
>
> As far as it does not require support the same code in different
> places, it's OK.

Usually such pattern requires refactoring of common code to separate
methods and the one to be reimplemented to others.

>
> > I think we should rather try to set the locations of TExpr more
> > correctly - this is similar problem btw, because to track the original
> > PExpr you would need to write all the code which would now be enough
> > to correct locations. And in case of locations we have something to
> > begin with.
>
> Sometimes TExpr totally lose the original location information. Lets
> take macro, for instance.

My point is that if you can't get the proper location for some TExpr
object, you would also have difficulty assigning it a correct
(meaningful) PExpr. And BTW, I thought that the main reason you need
this change is to track locations in a better way. If so, then we
should just try to focus on correcting the locations. For example if
there is a macro:

macro foo () {
  <[ ...lots of code..... ]>
}

then operating on original location of 'foo()' or the 'foo()'
expression itself does not make much difference. But supporting the
assignment of PExpr objects inside TExpr MAKES much difference versus
supporting assignment of locations, which we usually do by now.

One more note - if the locations stored in TExpr were more precise
(maybe after Michal's fix to disable Typer3-4 in completion mode it
will be such) you could realatively easy traverse original PExpr tree
of method to find out nodes matching the same exact location.

-- 
Kamil Skalski
http://nazgul.omega.pl



More information about the devel-en mailing list