On Thu, May 26, 2011 at 10:03 AM, Roger P. [email protected]
I was trying to learn about jruby’s parser.
After googling, I found this:
Am I to presume that this is outdated and the “real” jruby parser is
contained within jruby core now?
Actually, at one point we realized that the overhead of supporting the
parser in JRuby for both IDE uses and runtime uses was hurting
performance and overly complicating usage from within IDE’s. So we
extracted our parser source for core and created jruby-parser.
I very recently updated jruby-parser to be much closer in sync with
all the 1.9 parser fixes we made in the last year. If you are
interested in exact positioning of syntax then jruby-parser is for
you. If you want to hack on JRuby itself then perhaps hacking the
parser in our main source is what you want. I also changed the spec
format a bit and we needs lots of new specs written for syntax
positioning (wink wink - specs accepted).
The next release of community-ruby for NetBeans should be using
jruby-parser (still uses JRuby 1.5.1 for parsing atm).
Also does anybody know if such a thing as a jruby “unparser” exists or
what not (ruby -> ruby, basically, but with jruby [though I suppose I
could use caleb’s redparse with jruby])?
jruby-parser has an experimental rewriter (RewriterVisitor). So in
theory, you can swap out AST elements and re-generate Ruby source.
That code was originally contributed by the Eclipse RDT folks, so it
probably works for all the common cases of 1.8 (1.9 is likely a little
blog: http://blog.enebo.com twitter: tom_enebo
mail: [email protected]