Ripper (Ruby Language Parser) to be imported in the standard library?

Hi gurus and nubys,

I just read the blog from Jim Weirich about RC3 and discovered that
people talked about the need for a ruby parser usable from ruby.
Now I even remember that people pointed out the need for this, and
for the ability to access the built-in parsed representation a few
times.

I wonder if there is will to provide such a functionality in newer
release
(i.e. 1.9 or even better 1.8.2 ;).

I think the need to use a parser/lexer for the ruby syntax is quite
important for everyone taht wants to write tools to enhance the
programming experience

(syntax highlight for editors, refactoring stuff, possibly
rubyToWhateverOtherLang compilers, code beautyfiers, even IRB lexer
sometimes goes out of sync with the change to the syntax…)

Some info ?

Hi,

In mail “Ripper (Ruby Language Parser) to be imported in the standard library?”

I think the need to use a parser/lexer for the ruby syntax is quite
important for everyone taht wants to write tools to enhance the
programming experience

agreed.

FYI, I’m developping newer version of Ripper, Ruby Parser Extention.
Now almost all works are done. Notable change is:

  • Ruby 1.8 syntax support.
  • Ruby’s parse.y compatible. (Just #undef RIPPER)
  • NO backward compatibility :-\

Example:

~/c/ripper % head tools/strip.rb
last_is_void = false
ARGF.each do |line|
if line.strip.empty?
puts() unless last_is_void
last_is_void = true
elsif /\A#/ === line
;
else
print line
last_is_void = false
~/c/ripper % ruby sample/lex.rb tools/strip.rb | head
[“ident”, “last_is_void”]
[“sp”, " "]
[“op”, “=”]
[“sp”, " "]
[“kw”, “false”]
[“nl”, “\n”]
[“const”, “ARGF”]
[“period”, “.”]
[“ident”, “each”]
[“sp”, " "]

If you are interested in the latest ripper, check it out from
my CVS repository:

% cvs -d :pserver:anonymous@cvs.loveruby.net:/src co ripper

Note that not all samples are rewritten for current ripper.

Regards,
Minero Aoki

···

surrender_it@yahoo.it (gabriele renzi @ google) wrote:

Wonderful Minero!

I just checked it out, built it (and turned it into a Ruby gem :wink:

Now its time to install this in FreeRIDE.

-rich

···

On Nov 21, 2003, at 8:59 PM, Minero Aoki wrote:

FYI, I’m developping newer version of Ripper, Ruby Parser Extention.
Now almost all works are done. Notable change is:

  • Ruby 1.8 syntax support.
  • Ruby’s parse.y compatible. (Just #undef RIPPER)
  • NO backward compatibility :-\

Hi,

agreed.

FYI, I’m developping newer version of Ripper, Ruby Parser Extention.
Now almost all works are done. Notable change is:

  • Ruby 1.8 syntax support.
  • Ruby’s parse.y compatible. (Just #undef RIPPER)
  • NO backward compatibility :-\

hey, we can accept the #3 fact and have a party for the other two.
I have to ask questions more often :slight_smile:

If you are interested in the latest ripper, check it out from
my CVS repository:

% cvs -d :pserver:anonymous@cvs.loveruby.net:/src co ripper

still, I think this should go in the standard library CVS… someone
would start a poll please? :wink:

thank you very much for this

···

il Sat, 22 Nov 2003 10:59:24 +0900, Minero Aoki aamine@loveruby.net ha scritto::

Are you a (semi-)official gatekeeper for Ruby gems? That’d be nice,
as least while we’re still in the groundwork stage.

Gavin

···

On Saturday, November 22, 2003, 1:35:30 PM, Richard wrote:

Wonderful Minero!

I just checked it out, built it (and turned it into a Ruby gem :wink:

Is that still active? Nice to know! What’s the current status, and is
there a guide anywhere on porting existing packages?

martin

···

Richard Kilmer rich@infoether.com wrote:

Wonderful Minero!

I just checked it out, built it (and turned it into a Ruby gem :wink:

> Wonderful Minero!

>

> I just checked it out, built it (and turned it into a Ruby gem :wink:

···

On Sat, 22 Nov 2003, Martin DeMello wrote:

Richard Kilmer rich@infoether.com wrote:

Is that still active? Nice to know! What’s the current status, and is

there a guide anywhere on porting existing packages?

It was ressurected at RubyConf. We got quite a lot of it working in
Austin. No guide yet, but there are some examples you can pretty easily
understand.

Have a look at http://rubyforge.org/projects/rubygems if you’re
interested. It’s literally the result of some late nights and lunch
breaks during the Ruby Conference.

Chad