# \[ANN\] ruby\_parser 3.0.0.a7 Released

**URL:** <https://rubytalk.org/t/ann-ruby-parser-3-0-0-a7-released/66330>\
**Category:** ruby-talk\
**Created:** [21 September 2012 21:38 UTC](https://rubytalk.org/t/ann-ruby-parser-3-0-0-a7-released/66330 "2012-09-21T21:38:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan\_Davis1](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/ryan_davis1/32/1848_2.png) [@Ryan\_Davis1](https://rubytalk.org/u/Ryan_Davis1)\
**Post date:** [21 September 2012 21:38 UTC](https://rubytalk.org/t/ann-ruby-parser-3-0-0-a7-released/66330/1 "2012-09-21T21:38:28Z")

</div>

ruby\_parser version 3.0.0.a7 has been released!

\* rdoc: \<[http://docs.seattlerb.org/ruby\_parser](http://docs.seattlerb.org/ruby_parser)\>  
\* home: \<[https://github.com/seattlerb/ruby\_parser](https://github.com/seattlerb/ruby_parser)\>  
\* bugs: \<[https://github.com/seattlerb/ruby\_parser/issues](https://github.com/seattlerb/ruby_parser/issues)\>

ruby\_parser (RP) is a ruby parser written in pure ruby (utilizing  
racc--which does by default use a C extension). RP's output is  
the same as ParseTree's output: s-expressions using ruby's arrays and  
base types.

As an example:

&nbsp;&nbsp;def conditional1(arg1)  
&nbsp;&nbsp;&nbsp;&nbsp;if arg1 == 0 then  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return 1  
&nbsp;&nbsp;&nbsp;&nbsp;end  
&nbsp;&nbsp;&nbsp;&nbsp;return 0  
&nbsp;&nbsp;end

becomes:

&nbsp;&nbsp;s(:defn, :conditional1,  
&nbsp;&nbsp;&nbsp;s(:args, :arg1),  
&nbsp;&nbsp;&nbsp;s(:scope,  
&nbsp;&nbsp;&nbsp;&nbsp;s(:block,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s(:if,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s(:call, s(:lvar, :arg1), :==, s(:arglist, s(:lit, 0))),  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s(:return, s(:lit, 1)),  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nil),  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s(:return, s(:lit, 0)))))

Changes:

### 3.0.0.a7 / 2012-09-21

\* 3 minor enhancements:

&nbsp;&nbsp;\* Reorganized ruby\_parse\_extract\_error so it will start much faster with a bunch of glob directories  
&nbsp;&nbsp;\* RubyParserStuff#process takes optional time arg and raises Timeout::Error if it goes too long. You should rescue that, ya know...  
&nbsp;&nbsp;\* ruby\_parse\_extract\_error now checks \*.rake and Rakefile on dir scan.

\* 3 bug fixes:

&nbsp;&nbsp;\* 1.9: Fixed ternary state tracking so {a:f{f()},b:nil} won't trip up the lexer.  
&nbsp;&nbsp;\* Fixed optional values in block args (no20/no21)  
&nbsp;&nbsp;\* ruby\_parse\_extract\_error skips non-files. Some asshats put .rb on their dirs. ☹
