Categories: None [Edit]

ruby_parser

https://rubygems.org/gems/ruby_parser
https://github.com/seattlerb/ruby_parser
ruby_parser (RP) is a ruby parser written in pure ruby (utilizing racc--which does by default use a C extension). It outputs s-expressions which can be manipulated and converted back to ruby via the ruby2ruby gem. As an example: def conditional1 arg1 return 1 if arg1 == 0 return 0 end becomes: s(:defn, :conditional1, s(:args, :arg1), s(:if, s(:call, s(:lvar, :arg1), :==, s(:lit, 0)), s(:return, s(:lit, 1)), nil), s(:return, s(:lit, 0))) Tested against 801,039 files from the latest of all rubygems (as of 2013-05): * 1.8 parser is at 99.9739% accuracy, 3.651 sigma * 1.9 parser is at 99.9940% accuracy, 4.013 sigma * 2.0 parser is at 99.9939% accuracy, 4.008 sigma * 2.6 parser is at 99.9972% accuracy, 4.191 sigma * 3.0 parser has a 100% parse rate. * Tested against 2,672,412 unique ruby files across 167k gems. * As do all the others now, basically.

Total

Ranking: 269 of 172,883
Downloads: 78,482,825

Daily

Ranking: 293 of 172,875
Downloads: 78,253

Depended by

RankDownloadsName
88724,231,330html2haml
1,06317,929,296flay
1,14615,765,827gettext_i18n_rails
1,23313,789,335flog
1,30812,521,172ruby2ruby
1,7226,919,012rubycritic
2,2513,962,259fasterer
2,6492,733,441hairtrigger
2,8012,428,400protocol
3,0112,021,419roodi
3,1161,909,751churn
4,507805,533safemode
4,821690,812i18nliner
4,965646,133sourcify
5,405538,514debride
5,432532,348dawnscanner
6,241388,379quality
6,267383,627wrong
6,592344,008ripper_ruby_parser
7,097290,929partialruby

Depends on

RankDownloadsName
11618,760,160rake
163127,265,998racc
171120,976,302rdoc
24483,710,651sexp_processor
1,6267,677,405hoe
22,73742,668oedipus_lex

Owners

#GravatarHandle
1iconzenspider