Hi

Some time ago we've tried to get the comments placed in the AST. Then we
implemented the functionality in the Lexer. It was neither configurable nor
could it be disabled. Since it impaired the performance significantly the
changes have not been applied. Actually the lexer has not been the right
place to handle the comments anyway. But the code that creates the
commentnodes was ok, so a list which contains every comment is created
during parsing. This list is accessible through the parserresult.

For handling the comments in our refactorings in the RDT I've written a
class to place them in the ast by considering position information. Since
this logically belongs to JRuby and because the ReWriteVisitor, which is
able to rewrite comments now (but we have no chance to test this, as there
are no comments in the ast), I'd like to have the comment placer in Jruby.

Due to the performance issues it should be enabled only when needed. As
there had been some thoughts about different requirements of IDE- and
interpreter-users we (Mirko and I) had the idea to extend the parsersupport
by so called postprocessors. They can be added before parsing and are
applied to the parserresult after parsing. I've implemented the
commentplacer as such a postprocessor. Anybody who has special requirements
to modify the result could do this by implementing such a postprocessor.

I'll create an improvment patch if you think this is a good idea.

Thanks
Thomas



---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to