I am actually thinking of making some changes so that the intepreter
keeps a lighter version of sourceposition. So if we come up with some
way of configuring things, we can then have a slower but more
IDE-full-featured version of parser/lexer/sourceposition/etc.. and a
configuration that better fits interpretation.
With that said, it would be cool to get comments into the AST. I know
Tor Norbye had asked for this as well (or at least he was not
satisfied with the list of comments seperate from the AST). Your
patch needs to have no impact on interpretation. It sounds like post
processors is a good way to satisfy this. Patch away. Whether it
gets in for 1.0 is another option, but we can for sure put it in right
after that (but who knows maybe it could make 1.0).
-Tom
On 5/29/07, Thomas Corbat <[EMAIL PROTECTED]> wrote:
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
--
Blog: http://www.bloglines.com/blog/ThomasEEnebo
Email: [EMAIL PROTECTED] , [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email